0

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?

3
  • 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. Commented Sep 25, 2011 at 19:20
  • 1
    I 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. Commented Sep 25, 2011 at 19:22
  • 90%! Much better! I hope you get plenty of help of SO! :) Commented Sep 25, 2011 at 19:56

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.