Page 1 of 1

Multiple file upload using PHP

Posted: Mon Apr 30, 2007 12:14 pm
by chowner
Hey PHP folks,

Can anyone please tell me if multiple file uploading can be done in PHP? For example lf a person has 30 files and wants to upload all at once without having him to select each file and then upload. Working example in Flash: http://www.element-it.com/Examples/Mult ... pload.html but I want to do it in PHP.

P.S. Is uploading a whole folder also possible in PHP?

Thanks!

No

Posted: Mon Apr 30, 2007 2:34 pm
by dzysyak
PHP do not allws entrie folder uploads ony multiple files in a single form . :(

Posted: Mon Apr 30, 2007 2:52 pm
by chowner
So you are saying that http://www.element-it.com/Examples/Mult ... pload.html can be done in PHP too? In that flash uploader we can select all the files by using mouse or CTRL + SHIFT keys all at once and then upload

Posted: Mon Apr 30, 2007 4:10 pm
by dzysyak
Actually php handles only server side of file uploads. All client side is handled by the browser. So, php do not allows to upload several files from the same file html input. Here is what allowed by html/php

Code: Select all

<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>

Posted: Mon Apr 30, 2007 4:15 pm
by dzysyak
By the way, as far as I can see, flash applet you have shown just calling the same simple php script for each file in the list.

Actually that one

Posted: Mon Apr 30, 2007 5:46 pm
by RobertGonzalez
You are going to have to use some form of client side technology coupled with server side technology (PHP) to get what you want.