Allowing Client to Upload Multiple Files

P

Peter Lauren

I am building a web site and my server PCs are running Windows XP. I
would like the client to be able to upload multiple files. I have
considered the following.

1/ The following code from http://www.w3schools.com/TAGS/tag_select.asp.

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

The user would only be able to use one file at a time.

2/ A modification of 1 where the user uploads a zip file, containing
all the files to upload. The approach then would be to unzip the
files server-side. One approach suggest for this was PHP Zip
http://www.w3schools.com/php/php_ref_zip.asp . This link says to
download and install zziplib. I have never had any luck with zlib but
I thought I would try this. Bunch of error messages. Had to change
the .c suffices to .cpp and also find and download a bunch of .h
files. Even then I got a bunch of error messages when I tried to
compile.

3/ Unzipping the uploaded zip file server-side using pkzip.exe.
Should that work?

4/ Using ftp. Should that work? How would I implement it?

5/ Using Flash or Starlight. Are these free? Can they be used
server-
side?

Many thanks in advance for any feedback,
Peter.
 
E

Erwin Moller

I am building a web site and my server PCs are running Windows XP. I
would like the client to be able to upload multiple files. I have
considered the following.

1/ The following code from http://www.w3schools.com/TAGS/tag_select.asp.

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

The user would only be able to use one file at a time.

2/ A modification of 1 where the user uploads a zip file, containing
all the files to upload. The approach then would be to unzip the
files server-side. One approach suggest for this was PHP Zip
http://www.w3schools.com/php/php_ref_zip.asp . This link says to
download and install zziplib. I have never had any luck with zlib but
I thought I would try this. Bunch of error messages. Had to change
the .c suffices to .cpp and also find and download a bunch of .h
files. Even then I got a bunch of error messages when I tried to
compile.

3/ Unzipping the uploaded zip file server-side using pkzip.exe.
Should that work?

4/ Using ftp. Should that work? How would I implement it?

5/ Using Flash or Starlight. Are these free? Can they be used
server-
side?

6/ Create multiple file elements in your form. Check serverside which
ones were used (via $_FILES).
Read more here:
http://nl.php.net/manual/en/features.file-upload.multiple.php

That way you can offer more files.

Regards,
Erwin Moller
 
P

Peter Lauren

6/ Create multiple file elements in your form. Check serverside which
ones were used (via $_FILES).
Read more here:http://nl.php.net/manual/en/features.file-upload.multiple.php

That way you can offer more files.

Regards,
Erwin Moller

Hi Erwin,

Thank you so much for your reply. I tried all of the examples at that
link. My main problem is that the number of file elements is a
variable and typically on the order of 40-60 although it can be any
number. Hard coding a fixed number of elements would not work. Is
there a way to make the number of file elements a variable?

Thanks again,
Peter.
 
P

Peter Lauren

6/ Create multiple file elements in your form. Check serverside which
ones were used (via $_FILES).
Read more here:http://nl.php.net/manual/en/features.file-upload.multiple.php

That way you can offer more files.

Regards,
Erwin Moller

Hi Erwin,

Thank you so much for your reply. I tried all of the examples at that
link. My main problem is that the number of file elements is a
variable and typically on the order of 40-60 although it can be any
number. Hard coding a fixed number of elements would not work. Is
there a way to make the number of file elements a variable?

Thanks again,
Peter.
 
P

Peter Lauren

6/ Create multiple file elements in your form. Check serverside which
ones were used (via $_FILES).
Read more here:http://nl.php.net/manual/en/features.file-upload.multiple.php

That way you can offer more files.

Regards,
Erwin Moller

Hi Erwin,

Thank you so much for your reply. I tried all of the examples at that
link. My main problem is that the number of file elements is a
variable and typically on the order of 40-60 although it can be any
number. Hard coding a fixed number of elements would not work. Is
there a way to make the number of file elements a variable?

Thanks again,
Peter.
 
P

Peter Lauren

6/ Create multiple file elements in your form. Check serverside which
ones were used (via $_FILES).
Read more here:http://nl.php.net/manual/en/features.file-upload.multiple.php

That way you can offer more files.

Regards,
Erwin Moller

Hi Erwin,

Thank you so much for your reply. I tried all of the examples at that
link. My main problem is that the number of file elements is a
variable and typically on the order of 40-60 although it can be any
number. Hard coding a fixed number of elements would not work. Is
there a way to make the number of file elements a variable?

Thanks again,
Peter.
 
P

Peter Lauren

You multiposted your question. Multiposting is bad. Don't do multipost.

(I posted my answer to comp.infosystems.www.authoring.misc.)

I usually don't dignify such remarks with a comment. People cross
post all the time. If you don't like the way people post then start
your own moderated ng.
 
J

Jukka K. Korpela

I usually don't dignify such remarks with a comment. People cross
post all the time. If you don't like the way people post then start
your own moderated ng.

Thank you for making it clear that you do not even try to communicate
constructively. If you don't like the way Usenet works, please start
your own world.

Mostly just novices and fools crosspost, and the same applies even
stronger to multiposting (I don't expect you to know the difference).
 
J

Jonathan N. Little

Peter said:
I usually don't dignify such remarks with a comment. People cross
post all the time. If you don't like the way people post then start
your own moderated ng.


Oops did you step into it. Firstly multipost != crosspost.

You *did* mulitposted which is always bad. That is posting the same
message in different newsgroups as *separate* posts.

Crossposting on the other hand is *sometimes* acceptable when the topic
applies to more than one group. A crossposted message is only *one*
message sent as a *single* post but to more than one group at the same
time, this is accomplished with more than one group listed in the "To:"
field.
 
P

Peter Lauren

Oops did you step into it. Firstly multipost != crosspost.

You *did* mulitposted which is always bad. That is posting the same
message in different newsgroups as *separate* posts.

Crossposting on the other hand is *sometimes* acceptable when the topic
applies to more than one group. A crossposted message is only *one*
message sent as a *single* post but to more than one group at the same
time, this is accomplished with more than one group listed in the "To:"
field.

Thank you for explaining the difference. Had I cross-posted, this
pointless discussion about multiposting would be cluttering up two NGs
instead of one. Yucca appeared to be trying to make that happen
anyway but I'm not going to waste any more time replying to him.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top