javascript - How to fill an <input type="text"> with the value of the absolute filepath, chosen with a file upload dialog? -
this question has answer here:
- directory chooser in html page 5 answers
i'm working on django app (web). have awesome page form on it. want let user select file on local machine via nice file upload button <input type="file">
.
i don't care file content. care absolute path, i'd text field (or whatever) , submit html form.
my other option (unacceptable actually) let users write filepath in input field themselves... that's not cool @ all.
does sound doable?
most modern browsers don't give access filesystem. , when choose upload file, replace real path.
try: <input type="file" onchange="alert(this.value)"/>
will give c:\fakepath\myfile.txt
Comments
Post a Comment