upload multiple files

Reply

Join Date: Aug 2008
Posts: 14
Reputation: cosby is an unknown quantity at this point 
Solved Threads: 0
cosby cosby is offline Offline
Newbie Poster

upload multiple files

 
0
  #1
Aug 26th, 2008
hi everyone i am uploading multiple files with different names,so sometimes i want to upload a single
file within that form how do i handle that with php script.Can someone help me with php script that will allow you to upload name or picture ,or sometimes upload both at the same time using these form.

  1. <form action="file-upload.php" method="post" enctype="multipart/form-data">
  2. Send these files:<br />
  3. <input name="name[]" type="file" /><br />
  4. <input name="pictures[]" type="file" /><br />
  5. <input type="submit" value="Send files" />
  6. </form>
  7.  
  8. php script
  9. <?php
  10. $target = $_POST['path'];
  11. $fileone = $_FILES['name']['name'];
  12. $filetwo = $_FILES['picture']['name'];
  13. $Tdate = date('dFY');
  14. $path= "/home/myfiles/".$Tdate."/".basename($_FILES['upload']['name']) ;
  15. if(move_uploaded_file($_FILES['uploaded']['tmp_name'],$destfile))
  16. {
  17.  
  18. echo "copied succesfully to ".$destfile."<br/>";
  19. }
  20. else
  21. {
  22. echo "failed to copy<br/>";
  23. }
  24. ?>
Last edited by peter_budo; Aug 26th, 2008 at 4:33 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: upload multiple files

 
0
  #2
Aug 26th, 2008
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: Unrealx_ is an unknown quantity at this point 
Solved Threads: 1
Unrealx_ Unrealx_ is offline Offline
Newbie Poster

Re: upload multiple files

 
0
  #3
Aug 26th, 2008
This script is correct somehow..but do you mean random names to each of the files??
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC