Jump to content


Photo

File Uploads


  • Please log in to reply
4 replies to this topic

#1 00Sven

00Sven
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 31 July 2006 - 11:37 PM

Hi, I have been looking around this site for a while since I started PHP and finally decided to join.  Now on to the question...
I have set up a file uploader for my site.  This works perfectly except that I can only select one file at a time.  Is there a way that I can allow the user to select more than one file at a time?

#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 31 July 2006 - 11:40 PM

Several ways of doing this
<form method='post' action='' enctype='multipart/form-data'>
<input type='file' name='ufile[]' /><br />
<input type='file' name='ufile[]' />
Making the results into an array

or
<input type='file' name='ufile1' /><br />
<input type='file' name='ufile2' /><br />

and then loop through them

REMEMBER
when having file uploads in forms you need to name the enctype in the form tag
Tell me the problem, I will try tell you the solution

#3 00Sven

00Sven
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 31 July 2006 - 11:55 PM

Is there any way so that they can select multiple files when they click on the Browse button instead of needing to do one each time?

#4 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 01 August 2006 - 08:08 AM

No, the only way of doing this is to have more than 1 file upload fields. and array them like onlyican said. Althought I've used simelar methods.

#5 00Sven

00Sven
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 02 August 2006 - 02:20 AM

OK.  I have seen some things about FTP functions around.  Can those be used to do this? If so, can you recommend a place to learn them?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users