PHP: Uploading multiple files - Manual in Deutsh
PHP: Uploading multiple files - Manual in French
PHP: Uploading multiple files - Manual in Polish

You Are At PHP: Uploading multiple files - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevChapter 38. Handling file uploadsNext

Uploading multiple files

Multiple files can be uploaded using different name for input.

It is also 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:

Note: Support for multiple file uploads was added in PHP 3.0.10.

Example 38-4. Uploading multiple files

<form action="file-upload.php" method="post" enctype="multipart/form-data">
  Send these files:<br />
  <input name="userfile[]" type="file" /><br />
  <input name="userfile[]" type="file" /><br />
  <input type="submit" value="Send files" />
</form>

When the above form is submitted, the arrays $_FILES['userfile'], $_FILES['userfile']['name'], and $_FILES['userfile']['size'] will be initialized (as well as in $HTTP_POST_FILES for PHP versions prior to 4.1.0). When 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.

For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $_FILES['userfile']['name'][0] would contain the value review.html, and $_FILES['userfile']['name'][1] would contain the value xwp.out. Similarly, $_FILES['userfile']['size'][0] would contain review.html's file size, and so forth.

$_FILES['userfile']['name'][0], $_FILES['userfile']['tmp_name'][0], $_FILES['userfile']['size'][0], and $_FILES['userfile']['type'][0] are also set.

Internet
Szkolenia to norma dla każdego. Norma dla każdego.
zegarki szwajcarskie
Skuteczne pozycjonowanie stron katowice i cała Polska.
Pomoc drogowa 24h

Another Useful functions:


zend.ini-file-support | zend-api.zend-get-scanned-file-offset | zend-api.zend-file-handle-dtor | zend-api.zend-destroy-file-handle | zend-api.virtual-file-ex | zend-api.open-file-for-scanning | streams.file-api | function.xdiff-file-patch | function.xdiff-file-patch-binary | function.xdiff-file-merge3 | function.xdiff-file-diff | function.xdiff-file-diff-binary | function.set-file-buffer | function.mysqli-set-local-infile-handler | function.mysqli-set-local-infile-default | function.ifx-blobinfile-mode | function.file-put-contents | function.file-get-contents | function.file-exists | features.file-upload.put-method | features.file-upload.multiple | features.file-upload | features.file-upload.errors | features.file-upload.common-pitfalls |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.