From b097103f13d57577c0723debc90bf39def81d258 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Fri, 6 Jun 2003 03:56:11 +0000 Subject: [PATCH] Mention enctype="multipart/form-data" as being required for file uploads, and some minor text revisions. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@130331 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/file-upload.xml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/features/file-upload.xml b/features/file-upload.xml index 1a4ec512dd..4b9b8cd7f0 100644 --- a/features/file-upload.xml +++ b/features/file-upload.xml @@ -1,5 +1,5 @@ - + Handling file uploads @@ -34,6 +34,8 @@ A file upload screen can be built by creating a special form which looks something like this: + + File Upload Form @@ -46,9 +48,14 @@ Send this file: ]]> - The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden - field must precede the file input field and its value is the - maximum filesize accepted. The value is in bytes. + + + 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 + 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. It is easy to @@ -79,7 +86,7 @@ Send this file: The contents of $_FILES from our example script is as follows. Note that this assumes the use of the file upload name userfile, as used in the example - script above. + script above. This can be any name. $_FILES['userfile']['name']