I know that prefilling of <input type = file />
tags in HTML is not allowed due to security reasons. But is there any automated
way through scripts
of any sorts to fill the field with a prespecified file (by the user, and not the server
) in an automatic way?
Asked
Active
Viewed 2,097 times
1
-
didn't got your question, what do you mean by pre-filling here? – Mr. Alien Dec 22 '12 at 19:05
-
There might be workaround solutions. could you explain in more detail what you are trying to do? – Michel Feldheim Dec 22 '12 at 19:06
-
3wouldn't that defeat the purpose for which this is not allowed ? The only way is that the user clicks the browse and selects the file (*since the file input refers to local files, the user is obligated to go through the file selection window*) .. – Gabriele Petrioli Dec 22 '12 at 19:09
-
possible duplicate of [Dynamically set value of a file input](http://stackoverflow.com/questions/1017224/dynamically-set-value-of-a-file-input) – Donal Fellows Dec 22 '12 at 20:51
-
what i am trying to do is submit a form with a file upload required, now is there a way by either converting the html doc into raw form or otherwise to do this automatically?? since it is the user sending the file path so i think the security threat is overruled??? – mjnovice Dec 22 '12 at 21:11
1 Answers
1
This is not possible (for good reasons), and is in fact considered a security issue if it were possible to do so. Imagine if a server could automatically select a file on the user's computer to upload. Scary, huh?
You can see that Microsoft addressed this in a bug report.

zongweil
- 2,031
- 2
- 21
- 30