Multiple file upload using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chowner
Forum Newbie
Posts: 2
Joined: Mon Apr 30, 2007 12:10 pm

Multiple file upload using PHP

Post 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!
dzysyak
Forum Newbie
Posts: 4
Joined: Mon Apr 30, 2007 2:21 pm

No

Post by dzysyak »

PHP do not allws entrie folder uploads ony multiple files in a single form . :(
chowner
Forum Newbie
Posts: 2
Joined: Mon Apr 30, 2007 12:10 pm

Post 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
dzysyak
Forum Newbie
Posts: 4
Joined: Mon Apr 30, 2007 2:21 pm

Post 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>
dzysyak
Forum Newbie
Posts: 4
Joined: Mon Apr 30, 2007 2:21 pm

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply