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:

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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -