Page 1 of 1

HTML Experts, help me out

Posted: Tue Oct 12, 2004 7:26 pm
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?

Posted: Wed Oct 13, 2004 7:25 am
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.

Posted: Wed Oct 13, 2004 7:33 am
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.

Posted: Wed Oct 13, 2004 8:10 am
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.