I'm trying to create a drag and drop file upload UI. The problem is that I have to submit the files using an old fashioned multipart form. Is it possible to take the File objects you get from a drop event and somehow insert them into a form so they can be submitted to an iFrame like file inputs?
-
I would suggest going back to your previous questions and marking answers as 'the answer'. You have quite a low score of 22%. Not many people are going to be willing to answer your question because you aren't likely to mark there answer as "correct" if it's correct.Freesnöw– Freesnöw2011-09-25 19:20:51 +00:00Commented Sep 25, 2011 at 19:20
-
1I was just looking at that. Is that what that means? I'll take a look and see if any of my questions have been answered that I haven't marked. Thanks.nicholas– nicholas2011-09-25 19:22:25 +00:00Commented Sep 25, 2011 at 19:22
-
90%! Much better! I hope you get plenty of help of SO! :)Freesnöw– Freesnöw2011-09-25 19:56:45 +00:00Commented Sep 25, 2011 at 19:56
Add a comment
|
1 Answer
If you have to submit via a multi-part form, then no, there's no cross-browser way to do this. Browsers will not let JavaScript code update the value of any "file" input elements, for reasons that should be obvious (security - if your code code set a "file" input to any path, well ...).
There are newer ways of handling files, but in general there's still no way to create or copy a "file" element with a value.