Elegant file upload of multiple files

Reply

Join Date: Oct 2007
Posts: 260
Reputation: Venom Rush is an unknown quantity at this point 
Solved Threads: 2
Venom Rush's Avatar
Venom Rush Venom Rush is offline Offline
Posting Whiz in Training

Elegant file upload of multiple files

 
0
  #1
Jun 18th, 2008
Hi everyone

Does anyone know of a script that allows multiple file upload while only having one file input on the screen?

I think gmail does this. The user browses for an attachment and then clicks ok, the file is uploaded immediately and then the user can upload another file while any other fields that have been filled in retain their info.
This user has a spatula. We don't know why, but we are afraid.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Elegant file upload of multiple files

 
0
  #2
Jun 18th, 2008
Its done with hidden iframes.
http://www.adapa.si/products/lib/jav...th-iframe.aspx
Thats just one example but Googling 'iframe upload' will find umpteen examples.
Last edited by ShawnCplus; Jun 18th, 2008 at 1:16 pm.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 1
Reputation: brontosaur is an unknown quantity at this point 
Solved Threads: 0
brontosaur brontosaur is offline Offline
Newbie Poster

Re: Elegant file upload of multiple files

 
0
  #3
Jun 30th, 2008
i don't know if anyone is interested by these new flash products but make a try at
http://www.flashuploaded.com
there are nice flash upload components to integrate easily in a website with a upload progress bar time remaining, file/folder manager etc... i tried it and works very well.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 260
Reputation: Venom Rush is an unknown quantity at this point 
Solved Threads: 2
Venom Rush's Avatar
Venom Rush Venom Rush is offline Offline
Posting Whiz in Training

Re: Elegant file upload of multiple files

 
0
  #4
Jul 2nd, 2008
Hi there

I'm working on this again but I've run into a snag. What I'm doing at the moment is using i-frames to pull a page that has an input file field into the page where the user will be adding images.

My problem though is that I need to dynamically create a folder based on text input by the user on the main page and send the files that are uploaded in the pages pulled in with the i-frames to that folder.

Is it possible to use data in input fields as variables inside the pages being pulled in by the i-frames?

I'll post some code in a little bit.
This user has a spatula. We don't know why, but we are afraid.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 260
Reputation: Venom Rush is an unknown quantity at this point 
Solved Threads: 2
Venom Rush's Avatar
Venom Rush Venom Rush is offline Offline
Posting Whiz in Training

Re: Elegant file upload of multiple files

 
0
  #5
Jul 2nd, 2008
Main Page(index.php)
  1. <table width="100%" border="0" cellpadding="5" cellspacing="0">
  2. <tr>
  3. <td align="left" valign="top">Folder Name<input type="text" name="folderName" >
  4. </td>
  5. <td align="left" valign="top"><iframe style="border:none;" src="upload_01.php" height="50" width="221"></iframe></td>
  6. </tr>
  7. </table>
Page being pulled in with i-frame (upload_01.php)
  1. <table width="210" border="0" cellspacing="0" cellpadding="0">
  2. <tr>
  3. <td>Image 1<input type="file" name="image" id="image" onchange="submit()" /></td>
  4. </tr>
  5. </table>

So to explain this again...I need to use the name input by the user on index.php inside upload_01.php to create a folder on the server that the image will be uploaded to.

Any help would be greatly appreciated
This user has a spatula. We don't know why, but we are afraid.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,746
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 330
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Elegant file upload of multiple files

 
0
  #6
Jul 2nd, 2008
Umm.. I don't think you can do that. ie., textbox in index.php and file tag in upload_01.php . Why don't you have them both in upload_01.php ? This works for me.
  1. //index.php
  2. <?php
  3. print_r($_POST);
  4. ?>
  5. <table width="100%" border="0" cellpadding="5" cellspacing="0">
  6. <tr>
  7. <td align="left" valign="top"><iframe style="border:none;" src="upload_01.php" height="650" width="600"></iframe></td>
  8. </tr>
  9. </table>
and this is upload_01.php
  1. <form method="post" action="index.php">
  2. <table width="210" border="0" cellspacing="0" cellpadding="0">
  3. <tr>
  4. <td align="left" valign="top">Folder Name<input type="text" name="folderName" ></td>
  5. <td>Image 1<input type="file" name="image" id="image" onchange="javascript:form.submit()" /></td>
  6. </tr>
  7. </table>
  8. </form>
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 260
Reputation: Venom Rush is an unknown quantity at this point 
Solved Threads: 2
Venom Rush's Avatar
Venom Rush Venom Rush is offline Offline
Posting Whiz in Training

Re: Elegant file upload of multiple files

 
0
  #7
Jul 2nd, 2008
Hey nav33n...long time

The reason I have it the way I do is because I'm going to have 16 iframes on index.php with upload fields in them and I need to move the uploaded images to a folder that is created dynamically using the name that the user types into the text field.

The reason for all this madness is because it's not possible to have more than 4 concurrent connections to the server so when I try to upload more than 4 images, just using file fields on index.php, the images don't get uploaded.
This user has a spatula. We don't know why, but we are afraid.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,746
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 330
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Elegant file upload of multiple files

 
0
  #8
Jul 2nd, 2008
Long time indeed!
Hmm.. I don't think its possible, because, when you submit upload_01.php, it will submit that particular script and not index.php. Well, I hope someone else has an answer to your question..
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC