philip Thu Jun 5 23:56:11 2003 EDT Modified files: /phpdoc/en/features file-upload.xml Log: Mention enctype="multipart/form-data" as being required for file uploads, and some minor text revisions. Index: phpdoc/en/features/file-upload.xml diff -u phpdoc/en/features/file-upload.xml:1.59 phpdoc/en/features/file-upload.xml:1.60 --- phpdoc/en/features/file-upload.xml:1.59 Mon Apr 21 17:25:34 2003 +++ phpdoc/en/features/file-upload.xml Thu Jun 5 23:56:11 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.59 $ --> +<!-- $Revision: 1.60 $ --> <chapter id="features.file-upload"> <title>Handling file uploads</title> @@ -34,6 +34,8 @@ <para> A file upload screen can be built by creating a special form which looks something like this: + </para> + <para> <example> <title>File Upload Form</title> <programlisting role="html"> @@ -46,9 +48,14 @@ ]]> </programlisting> </example> - 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. + </para> + <para> + 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 + <literal>enctype="multipart/form-data"</literal> otherwise the file + upload will not work. <warning> <para> The MAX_FILE_SIZE is advisory to the browser. It is easy to @@ -79,7 +86,7 @@ The contents of <link linkend="reserved.variables.files">$_FILES</link> from our example script is as follows. Note that this assumes the use of the file upload name <emphasis>userfile</emphasis>, as used in the example - script above. + script above. This can be any name. <variablelist> <varlistentry> <term><varname>$_FILES['userfile']['name']</varname></term>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php