Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
290416f3
Kaydet (Commit)
290416f3
authored
Nis 30, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue11352 - Update cgi module docs
üst
e654c11f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
cgi.rst
Doc/library/cgi.rst
+10
-7
No files found.
Doc/library/cgi.rst
Dosyayı görüntüle @
290416f3
...
@@ -86,11 +86,14 @@ produced by :mod:`cgitb` provide information that can save you a lot of time in
...
@@ -86,11 +86,14 @@ produced by :mod:`cgitb` provide information that can save you a lot of time in
tracking down bugs. You can always remove the ``cgitb`` line later when you
tracking down bugs. You can always remove the ``cgitb`` line later when you
have tested your script and are confident that it works correctly.
have tested your script and are confident that it works correctly.
To get at submitted form data, use the :class:`FieldStorage` class. Instantiate
To get at submitted form data, use the :class:`FieldStorage` class. If the form
it exactly once, without arguments. This reads the form contents from standard
contains non-ASCII characters, use the *encoding* keyword parameter set to the
input or the environment (depending on the value of various environment
value of the encoding defined for the document. It is usually contained in the
variables set according to the CGI standard). Since it may consume standard
META tag in the HEAD section of the HTML document or by the
input, it should be instantiated only once.
:mailheader:`Content-Type` header). This reads the form contents from the
standard input or the environment (depending on the value of various
environment variables set according to the CGI standard). Since it may consume
standard input, it should be instantiated only once.
The :class:`FieldStorage` instance can be indexed like a Python dictionary.
The :class:`FieldStorage` instance can be indexed like a Python dictionary.
It allows membership testing with the :keyword:`in` operator, and also supports
It allows membership testing with the :keyword:`in` operator, and also supports
...
@@ -136,10 +139,10 @@ commas::
...
@@ -136,10 +139,10 @@ commas::
If a field represents an uploaded file, accessing the value via the
If a field represents an uploaded file, accessing the value via the
:attr:`value` attribute or the :func:`getvalue` method reads the entire file in
:attr:`value` attribute or the :func:`getvalue` method reads the entire file in
memory as
a string
. This may not be what you want. You can test for an uploaded
memory as
bytes
. This may not be what you want. You can test for an uploaded
file by testing either the :attr:`filename` attribute or the :attr:`!file`
file by testing either the :attr:`filename` attribute or the :attr:`!file`
attribute. You can then read the data at leisure from the :attr:`!file`
attribute. You can then read the data at leisure from the :attr:`!file`
attribute::
attribute
(the :func:`read` and :func:`readline` methods will return bytes)
::
fileitem = form["userfile"]
fileitem = form["userfile"]
if fileitem.file:
if fileitem.file:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment