faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input : File Uploads

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

43 of 203 people (21%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I upload multiple files in one PHP script?
Can I create a form that enables the upload of multiple files?

Jun 28th, 1999 03:09
Nathan Wallace, Onno Benschop, Sascha Schumann, Mike Robinson


PHP (and most browsers, including Netscape) follow RFC 1867
("Form-based File Upload in HTML") which allows for multiple
files to be uploaded.

Uploading multiple files should work by using various NAME attributes in
the HTML code, i.e.

<input type=file name=file1>
<input type=file name=file2>
<input type=file name=file3>

You could even try it this way

<input type=file name=file[]>
<input type=file name=file[]>
<input type=file name=file[]>