mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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
This commit is contained in:
parent
7455fa9005
commit
b097103f13
1 changed files with 12 additions and 5 deletions
|
@ -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 @@ Send this file: <input name="userfile" type="file">
|
|||
]]>
|
||||
</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 @@ Send this file: <input name="userfile" type="file">
|
|||
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>
|
||||
|
|
Loading…
Reference in a new issue