Closed Bug 189978 Opened 19 years ago Closed 18 years ago
input type="file" ignores value and style
while the first table row below renders perfectly, the second one neither shows a value nor is a wide as the subject ... <tr><th>Subject:</th><td colspan="7"> <input class="Text" name="subject" style="width: 99%; font-style: italic;" value="Your subject ..." /></td></tr> <tr><th><label for="attached_file">Attachments:</label></th> <td colspan="7"><input type="file" id="uploaded_file" name="attached_file" style="width: 99%;" value="C:\Documents and Settings\rhauser\My Documents\Contract.doc" /></td></tr> Build 2003011412
We ignore "value" because otherwise any website would be able to grab arbitrary files from your computer. Not a good idea. ;) The style issue is bug 52500, looks like.
Depends on: input[type=file]
just wondering, but even if you didn't ignore value, a user still would have to press the submit form button? Wouldn't an option be to require that the "browse" button is pressed and otherwise the pre-filled value remains grey/disabled? Or that an extra o.k. dialog is popped up if the file path hasn't been change by the user and thus possibly overseen in its importance?
> a user still would have to press the submit form button No. You can submit forms programmatically from JS (HTMLFormElement.submit()). The changes you suggest don't provide significant utility while severely decreasing security. The value thing has been decided and that decision is not changing.
*** This bug has been marked as a duplicate of 52500 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
I don't know what the user wanted to do exactly, but I've just submitted an enhancement request related to this one concerning the ignored value: bug 323684 (input type="file" value should be remembered in a history database), in case you are interested...
You need to log in before you can comment on or make changes to this bug.