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.
> I would like the client to be able to upload multiple files.
The most convenient way from the user perspective is the attribute multiple
in the file input field: <input type=file name=foo id=files multiple>. On
supporting browsers, the user can select any number of files when using the
file selection widget.
As many browsers still don't support this nice feature, you might include,
say, ten <input type=file> fields, assuming ten is a reasonable maximum. And
you could use the multiple attribute in the first of those fields and use
JavaScript to hide the other fields if the multiple attribute is supported -
you can test this using the expression
document.getElementById("files").multiple as condition.
--
Yucca
Hi Jukka,
Thank you so much for your reply. My problem is that the number of
<input type=file> fields is variable and typically on the order of
40-60. A reasonable maximum would be 70 to 80. I am leaning towards
using a for loop which would probably involve a mixture of html and
JavaScript on the client side. Of course the former solution, which I
understand will be available in html5, would be ideal. Maybe I could
have an if statement to see whether it is available on the client
browser. Do you know the syntax for checking for that?
Thanks again,
Peter.
> Of course the former solution, which I
> understand will be available in html5, would be ideal. Maybe I could
> have an if statement to see whether it is available on the client
> browser. Do you know the syntax for checking for that?
It was in my message, in the part you quoted (you quoted it all).
I'm not interested in participating more in a multiposted discussion.
--
Yucca, http://www.cs.tut.fi/~jkorpela/