How to upload multiple files to your website
By Justin Silverton
If you own a website of any kind and have ever wanted to allow your users to upload multiple files from a single screen, you have a few choices:
- a java applet
- an active X control
- A Flash app
- multiple file input elements (which is messy and not very efficient)
The following is a much easier way to allow multiple file uploads. Using DOM (The Document object Model), one file upload box can be created making it much easier and more user-friendly.

Installation and usage
Installation is pretty easy. The download includes sample code that you can use on your website.
All files and example of usage can be downloaded Here.
22 Comments so far
Leave a reply






It seems to be that the link on the download page is broken.
Try downloading it again.
The zip download has three files - config.m4, hello.c, and php_hello.h. I don’t see any example of usage. Thanks for your help.
try it again. The download link was pointing to the wrong file.
I can not find “How to upload multiple files to your website” hmmm…??????
Richard, I updated the download link. If you scroll down on the downloads page, you will see a link to download the code to add multiple file uploads to your site.
Thanks!! I downloaded it :O)
Now all I have to do is figure out how to use it! ha :O)
Thanks again!
Does anyone have the “multi upload files” installed on thier website? I’d really like to see it. I’m having trouble with the html code.
Thanks
what kind of problems are you having?
I have MULITIFILE.JS and MULTIFILE_COMPRESS.JS.
Where do these go and why 2 of them?
Also, where do I direct it to the correct dir. for the uploads? And what all do I need to change in the EXAMPLE.HTML to use it?
Thanks!
Hello………….. Justin?
Richard,
you only need to use one (multifile.js OR multifile_compress.js). The compressed version is just a smaller version of multifuke.js. They both have the same functionality.
The directory needs to be changed within the included .php file.
I must be missing something here.
Has anyone out there got this upload files thing to work?
The “included .php file” is not there. There are only 3 files in the zipped download,… multifile.js, multifile_compress.js and a html example.
Thank you very much for any help.
Richard
Richard,
I created a new example for you which includes all the necessary php and html.
Here is the link:
http://www.whenpenguinsattack.com/DownloadFiles/multiple_files_new.zip
am trying to upload multiple images.however, am just doing it for a school project.do you know of any codes that uses aspx? visual studios.
Justin,
Great little script, does just what it says on the tin. I have only two tiny problems, instead of Upload Now on the submit button, I get Submit Query. Can this be amended somewhere? After the PHP has run I’m left with a blank page, is there a way to automatically go back to upload page, where I can add an html link to tell and take the user to the uploaded files.
Ian M
Hi Justin. The first problem can be solved by adding a value=”whatever” ie:
Whatever is in the value= ’s is what will be on the button.
Problem 2: Try adding this after your php code.
Having the SUBMIT button display whatever you want, just add a value= "s to the INPUT line, ie: <input type="submit" value="Submit Order" name="B1">And as for winding up showing a blank page after the php has run. This shows a button that allows you to go back 1 page on the browser. Just put it AFTER your ?> ends. ie:
?>
<FORM>
<FONT SIZE="-1" FACE="ARIAL,HELVETICA"><INPUT TYPE="button" VALUE="Back" onClick="window.location='Javascript:history.go(-1)'">
</FONT>
</FORM>
This will give you a button to take you back 1 page in your browser. Again, whatever is in the value= ’s is what will be on the button.
I hope this helps, Richard
I am getting the error below. Any ideas how to fix this. My files are on a hosted web server so I access everything through a control panel.
Warning: move_uploaded_file(/usr/home/etenaz/domains/fresnosoccerforum.com/public_html/uploadfiles/uploads/August_TASKList.txt): failed to open stream: Permission denied in /usr/home/etenaz/domains/fresnosoccerforum.com/public_html/uploadfiles/upload.php on line 15
Orlando,
it sounds like you don’t have write permission set in the uploads directory. You might want to see if your control panel allows you to change permissions on a folder.
[…] read more | digg story […]
how do i upload files to my own shopping chart website
i want to upload threee files in differrent file upload controls i use html file uploader i use httpcollection class but it is not going succesfully if any body know this code so please send to my website that is
neeraj_eci@rediffmail.com