I want to allow users to drag and drop (or select) a file from their computer and load it into a textbox with JavaScript.
Is it possible to load a local file with JavaScript into a textbox? If yes, then how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think everything you would want for HTML5 is included in remy/html5demos on github.
As an example, I modified http://html5demos.com/file-api to accept text files and display them in the browser.
See the jsfiddle.
Edit
Relevant script: