cvs: phpdoc /en/features file-upload.xml

From: Date: Thu, 14 Feb 2002 19:35:20 +0000
Subject: cvs: phpdoc /en/features file-upload.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969342316@lists.php.net to get a copy of this message
goba Thu Feb 14 14:35:20 2002 EDT Modified files: /phpdoc/en/features file-upload.xml Log: Correcting several mistakes, and misspellings Index: phpdoc/en/features/file-upload.xml diff -u phpdoc/en/features/file-upload.xml:1.33 phpdoc/en/features/file-upload.xml:1.34 --- phpdoc/en/features/file-upload.xml:1.33 Tue Feb 12 17:21:55 2002 +++ phpdoc/en/features/file-upload.xml Thu Feb 14 14:35:20 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.33 $ --> +<!-- $Revision: 1.34 $ --> <chapter id="features.file-upload"> <title>Handling file uploads</title> @@ -54,11 +54,10 @@ version and configuration. Following variables will be defined within the destination script upon a successful upload. When <link linkend="ini.track-vars">track_vars</link> is enabled, - $HTTP_POST_FILES/ $_FILES array is initialized. <link - linkend="ini.track-vars">track_vars</link> is always on from PHP - 4.0.3. Finally, related variables may be initialized as globals - when <link linkend="ini.register-globals">register_globals</link> - is turned on . However, use of globals is not recommended anymore. + $HTTP_POST_FILES/$_FILES array is initialized. Finally, related + variables may be initialized as globals when + <link linkend="ini.register-globals">register_globals</link> + is turned on. However, use of globals is not recommended anymore. </para> <note> <para> @@ -119,8 +118,8 @@ </para> <note> <para> - PHP 4.1.0 or later supports short track var variable - <varname>$_FILES</varname>. PHP3 does not support + PHP 4.1.0 or later supports a short track variable + <varname>$_FILES</varname>. PHP 3 does not support <varname>$HTTP_POST_FILES</varname>. </para> </note> @@ -159,9 +158,9 @@ </listitem> </itemizedlist> Note that the "<varname>$userfile</varname>" part of the above - variables is whatever the name of the INPUT field of TYPE=file is - in the upload form. In the above upload form example, we chose to - call it "userfile" + variables is whatever the name of the &lt;input&gt; field of + type="file" is in the upload form. In the above upload form + example, we chose to call it "userfile". </para> <note> <para> @@ -195,7 +194,7 @@ if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { copy($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file"); } else { - echo "Possible file upload attack: filename '".$HTTP_POST_FILES['userfile']['name']."."; + echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['userfile']['name']; } /* ...or... */ move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file"); @@ -296,9 +295,9 @@ <varname>$HTTP_POST_FILES['userfile']</varname>, <varname>$HTTP_POST_FILES['userfile']['name']</varname>, and <varname>$HTTP_POST_FILES['userfile']['size']</varname> will be - initialized. (as well as in $_FILES for PHP 4.1.0 or + initialized. (As well as in $_FILES for PHP 4.1.0 or later. $HTTP_POST_VARS in PHP 3. When - <literal>register_globals</literal> is on, Globals for uploaded + <literal>register_globals</literal> is on, globals for uploaded files are also initialized). Each of these will be a numerically indexed array of the appropriate values for the submitted files. </simpara>

« previous php.doc (#969342316) next »