Jump to content

Archived

This topic is now archived and is closed to further replies.

00Sven

File Uploads

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.