Forum Moderators: open

Message Too Old, No Replies

<INPUT TYPE=FILE...> Form Tag

File Upload Tags etc.

         

lak12

8:45 pm on Apr 7, 2001 (gmt 0)

10+ Year Member



Hi everybody!
I have a question about the <INPUT TYPE=FILE> HTML tag. I have used file upload with success for a number of years now and I need to implement the VALUE option in this tag...
It doesn't work!
I used it in a form where people use the textarea to submit a number of files, I process those names in a script and convert them if necessary and want to show on the next page as a separate <INPUT TYPE=FILE> fields. I include VALUE= option (of course I use NAME= tag as well) and the value just wouldn't show in the field and the whole upload isn't working unless you manually select the file name by clicking on "Browse" button.

Any ideas, experience, suggestions??!!!
Thanks.
Mark.

Edited by: lak12

tedster

10:57 pm on Apr 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've only ever used the BROWSE button for a file upload. My first thought is that the file input for a form does not accept mulitple entries -- one file at a time is all I've ever seen. The W3C Recommendation [w3.org] only talks about single values.

Second thought -- typing files into a textarea runs into typo problems on the file names, doesn't it?

Third thought -- I think I remember that the value attribute for INPUT type=file was very buggy in all browsers when HTML 3.2 first came out. I'm not sure this was ever addressed. It's not used very much, that's for sure.

I realize that all this is not a definitive answer. Hopefully someone with experience in this area will help out.

lak12

12:15 am on Apr 8, 2001 (gmt 0)

10+ Year Member



Thanks tedster!
I did use file upload with multiple entries in the past with cgi-li.pl - it works fine. The most I used it was about 30 files. The only thing is you have to specify proper amount of data to be sucked by cgi-lib.pl in settings. That's the only limit as far as I know.
As far as typo goes I do check the file names in the script and on the end if there is no file that was entered - nothing bad happens.
The only problem is the VALUE option and I can't figure it out as everything should work but it doesn't...
I hope someone may post some information on that.
Cheers.
Mark.

Froggyman

3:12 am on Apr 9, 2001 (gmt 0)



Here is some info [blooberry.com]. Be sure to read Browser Peculiarities on the bottom of the article.

lak12

3:25 am on Apr 9, 2001 (gmt 0)

10+ Year Member



Thanks Froggyman!
That's a good explanation not to use VALUE in this field...
Mark.

tedster

4:01 am on Apr 9, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So if I read this correctly, scripted input for the VALUE attribute is not supported (in any browser) in order to protect the user against malicious input.

That's useful knowledge -- thanks!

lak12

4:08 am on Apr 9, 2001 (gmt 0)

10+ Year Member



Yeap! That's the idea. I agree with that, but unfortunately it cost me 2 days to find out :-))
Cheers.
Mark.

Soapie

4:34 pm on May 3, 2001 (gmt 0)



Hi people,

YOu all seem like you might know the answer to my problem. I need to write a page that allows a web user to choose a number of files from their local machine and allow them to upload these files to a directory on a server by clicking a button! I'm using the aspSmartUpload object to handle the actual upload and this object supports multiple file uploads. However, the problem arises with actually allowing the user to choose multiple files. THe <input type=file> tag only seems to allow one file at a time. Do you have any suggestions for me?

Thanks
Marina

lak12

5:51 am on May 4, 2001 (gmt 0)

10+ Year Member



Hey Marina!
I am not sure that your problem can be resolved. I had the same problem and all my research shows that named tag would not accept VALUE option and you can not submit files using TEXTAREA tag. And to my best knowledge FILE type tag would accept only one value as a result of browsing the HD content or if correct path is entered by the keyboard.
I hope that helps.
Regards.
Mark.

Soapie

9:09 am on May 4, 2001 (gmt 0)



Hey Mark

Thanks for the info. Think I'm just going to get the user to zip up the necessary files and get the server to then do the necessary unzip. Not ideal, but I guess it's acceptable in this situation.

:)
Marina

Brett_Tabke

11:22 am on Jun 1, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The scripting discussion that started in this thread, was moved to the scripting forum [webmasterworld.com]