HTML Experts, help me out

This is the place for questions and issues relating to the web site or the forums.

Moderator: Moderators

Post Reply
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

HTML Experts, help me out

Post by The Robman »

Hey Lucy, is that you??? :?: 8)

Here's what I'm trying to do. I've compiled a spreadsheet that lists all the Device Upgrade files from Yahoo along with their descriptions and their authors. My intent is to write some HTML to fake out the upload process on my new File Section, so all I have to do is press a button and the file gets loaded. I would then make the spreadsheet write the HTML for me.

Well, I have it all working except for the file part. If I leave the file section box un-hidden with the BROWSE button active, i can use the browse button to select a file and load it, this much works. But what I want to be able to do is hard code the file name into the INPUT statement of the HTML form, then all I'd have to do is press the button, and voila, but this is the part I can't get working.

Does anybody have any ideas how I can make this work, or maybe think of a different way of approaching it?
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
gfb107
Expert
Posts: 3411
Joined: Sun Aug 03, 2003 7:18 pm
Location: Cary, NC
Contact:

Post by gfb107 »

According to http://www.cs.tut.fi/~jkorpela/forms/file.html#value the value parameter is supposed to allow you to specify a default file name, but it doesn't work in any browser.
pgk
Posts: 113
Joined: Sat Aug 21, 2004 11:53 am
Location: London

Post by pgk »

Rob,

I believe you can't do it that way, most (all?) browsers don't accept a value clause on <input type=file> statements for security reasons. i.e. To stop me tricking people into uploading files I want, rather than ones they select.

Paul.
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

Thanks guys, and thanks for that link Greg, that pretty much answers the question, and I agree with them that it would be a security risk if what I am trying to do was allowed across the board.

I got a few files loaded last night by manually selecting the file but letting the hard coded HTML take care of the other details, so I will probably continue doing it that way.

Having said that, I might take one last look into Java Script to see if I can make it copy the value from one place to another when I click on the SUBMIT button.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Post Reply