From aea1f55f43b2badf9dc1d3168eddef1afbf3e258 Mon Sep 17 00:00:00 2001 From: Alexander Voytsekhovskyy Date: Wed, 26 May 2004 20:54:06 +0000 Subject: [PATCH] cosmetic changes git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@159748 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/file-upload.xml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/features/file-upload.xml b/features/file-upload.xml index b93069b9eb..2e02dfe9fc 100644 --- a/features/file-upload.xml +++ b/features/file-upload.xml @@ -1,5 +1,5 @@ - + Handling file uploads @@ -53,18 +53,18 @@ The "_URL_" in the above example should be replaced, and point to a PHP - file. The MAX_FILE_SIZE hidden field (measured in bytes) must precede + file. The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted. Also, be sure your file upload form has enctype="multipart/form-data" otherwise the file upload will not work. - The MAX_FILE_SIZE is advisory to the browser, although PHP also checks + The MAX_FILE_SIZE is advisory to the browser, although PHP also checks it. Changing this on the browser size is quite easy, so you can never rely on files with a greater size being blocked by this feature. The PHP-settings for maximum-size, however, cannot be fooled. You should add - the MAX_FILE_SIZE form variable anyway as it saves users the trouble of + the MAX_FILE_SIZE form variable anyway as it saves users the trouble of waiting for a big file being transferred only to find that it was too big and the transfer actually failed. @@ -218,7 +218,7 @@ print ""; If no file is selected for upload in your form, PHP will return - $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as + $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as none. @@ -239,7 +239,7 @@ print ""; - UPLOAD_ERR_OK + UPLOAD_ERR_OK Value: 0; There is no error, the file uploaded with success. @@ -247,7 +247,7 @@ print ""; - UPLOAD_ERR_INI_SIZE + UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the @@ -257,7 +257,7 @@ print ""; - UPLOAD_ERR_FORM_SIZE + UPLOAD_ERR_FORM_SIZE Value: 2; The uploaded file exceeds the MAX_FILE_SIZE @@ -266,7 +266,7 @@ print ""; - UPLOAD_ERR_PARTIAL + UPLOAD_ERR_PARTIAL Value: 3; The uploaded file was only partially uploaded. @@ -274,7 +274,7 @@ print ""; - UPLOAD_ERR_NO_FILE + UPLOAD_ERR_NO_FILE Value: 4; No file was uploaded. @@ -336,9 +336,9 @@ print ""; sensitive information in other directories. - Please note that the CERN httpd seems to strip off everything + Please note that the CERN httpd seems to strip off everything starting at the first whitespace in the content-type mime header - it gets from the client. As long as this is the case, CERN httpd + it gets from the client. As long as this is the case, CERN httpd will not support the file upload feature. @@ -347,7 +347,7 @@ print ""; A developer may not mix normal input fields and file upload fields in the same - form variable (by using an input name like foo[]). + form variable (by using an input name like foo[]). @@ -388,10 +388,10 @@ print ""; $_FILES['userfile'], $_FILES['userfile']['name'], and $_FILES['userfile']['size'] will be - initialized (as well as in $HTTP_POST_FILES for PHP versions prior + initialized (as well as in $HTTP_POST_FILES for PHP versions prior to 4.1.0). 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. @@ -465,7 +465,7 @@ PUT /path/filename.html HTTP/1.1 This would normally mean that the remote client would like to save - the content that follows as: /path/filename.html in your web tree. + the content that follows as: /path/filename.html in your web tree. It is obviously not a good idea for Apache or PHP to automatically let everybody overwrite any files in your web tree. So, to handle such a request you have to first tell your web server that you @@ -506,9 +506,9 @@ Script PUT /put.php linkend="features.file-upload.post-method">POST-method. When the request ends, this temporary file is deleted. So, your PUT handling PHP script has to copy that file somewhere. The - filename of this temporary file is in the $PHP_PUT_FILENAME + filename of this temporary file is in the PHP_PUT_FILENAME variable, and you can see the suggested destination filename in - the $REQUEST_URI (may vary on non-Apache web servers). This + the REQUEST_URI (may vary on non-Apache web servers). This destination filename is the one that the remote client specified. You do not have to listen to this client. You could, for example, copy all uploaded files to a special uploads directory.