diff --git a/features/file-upload.xml b/features/file-upload.xml index 4b3d239017..354cc3c1e3 100644 --- a/features/file-upload.xml +++ b/features/file-upload.xml @@ -1,5 +1,5 @@ - + Handling file uploads @@ -54,11 +54,10 @@ Send this file: version and configuration. Following variables will be defined within the destination script upon a successful upload. When track_vars is enabled, - $HTTP_POST_FILES/ $_FILES array is initialized. track_vars is always on from PHP - 4.0.3. Finally, related variables may be initialized as globals - when register_globals - 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 + register_globals + is turned on. However, use of globals is not recommended anymore. @@ -119,8 +118,8 @@ Send this file: - PHP 4.1.0 or later supports short track var variable - $_FILES. PHP3 does not support + PHP 4.1.0 or later supports a short track variable + $_FILES. PHP 3 does not support $HTTP_POST_FILES. @@ -159,9 +158,9 @@ Send this file: Note that the "$userfile" 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 <input> field of + type="file" is in the upload form. In the above upload form + example, we chose to call it "userfile". @@ -195,7 +194,7 @@ Send this file: 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 @@ move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uplo $HTTP_POST_FILES['userfile'], $HTTP_POST_FILES['userfile']['name'], and $HTTP_POST_FILES['userfile']['size'] 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 - register_globals is on, Globals for uploaded + register_globals 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.