CVS update: php3/doc/chapters

From: Date: Sun, 13 Jun 1999 22:58:45 +0000
Subject: CVS update: php3/doc/chapters
Groups: php.dev 
Request: Send a blank email to php-dev+get-6937@lists.php.net to get a copy of this message
Date: Sunday June 13, 1999 @ 18:58 Author: cslawi Update of /repository/php3/doc/chapters In directory php:/tmp/cvs-serv11508/chapters Modified Files: features.sgml Log Message: Added docs for uploading multiple files. Index: php3/doc/chapters/features.sgml diff -u php3/doc/chapters/features.sgml:1.33 php3/doc/chapters/features.sgml:1.34 --- php3/doc/chapters/features.sgml:1.33 Fri Jun 4 13:24:30 1999 +++ php3/doc/chapters/features.sgml Sun Jun 13 18:58:45 1999 @@ -246,6 +246,49 @@ 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 will not support the file upload feature. + + <sect2 id="feature-fileupload.multiple"> + <title>Uploading multiple files</title> + <simpara> + As of PHP 3.0.10, it is possible to upload multiple files + simultaneously and have the information organized automatically + in arrays for you. To do so, you need to use the same array + submission syntax in the HTML form as you do with multiple + selects and checkboxes: + + <para> + <example> + <title>Uploading multiple forms</title> + <programlisting> +&lt;form action=&quot;file-upload.html&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt; + Send these files:&lt;br&gt; + &lt;input name=&quot;userfile[]&quot; type=&quot;file&quot;&gt;&lt;br&gt; + &lt;input name=&quot;userfile[]&quot; type=&quot;file&quot;&gt;&lt;br&gt; + &lt;input type=&quot;submit&quot; value=&quot;Send files&quot;&gt; +&lt;/form&gt; + </programlisting> + </example> + + <simpara> + When the above form is submitted, the arrays <computeroutput>$userfile</computeroutput>, + <computeroutput>$userfile_name</computeroutput>, and + <computeroutput>$userfile_size</computeroutput> will be formed in the global + scope (as well as in $HTTP_POST_VARS). Each of these will be a + numerically indexed array of the appropriate values for the + submitted files. + + <simpara> + For instance, assume that the filenames + <filename>/home/test/review.html</filename> and + <filename>/home/test/xwp.out</filename> are submitted. In this + case, <computeroutput>$userfile_name[0]</computeroutput> would contain + the value <computeroutput>review.html</computeroutput>, and + <computeroutput>$userfile_name[1]</computeroutput> would contain the + value <computeroutput>xwp.out</computeroutput>. Similarly, + <computeroutput>$userfile_size[0]</computeroutput> would contain + <filename>review.html</filename>'s filesize, and so forth. + </sect2 + </sect1> <sect1 id="feature-putsupport">

« previous php.dev (#6937) next »