开发者

Upload a file to an html page with no backend?

Is it possible to read the contents of an uploaded file (through <form><input type="file">) from inside javascript with 开发者_如何学Pythonno backend? I suppose it's possible with HTML5, but what about HTML4?


You can read (not upload - well, you can upload too, but that's like sending fan-mail to Edgar Allen Poe; nothing stops you but he won't be able to read it) from files if your script runs in a very trusted context.

If anyone on your network is browsing the web in a browser set to give that much trust, disconnect their machine from the network first, make their settings tighter second.


I don't know if I understand correctly. How about using something like uploadify together with jQuery. I guess you'll have to grant the webserver the privilege to write in the specified folders.


The security model will not let you unless you change the security to allow this. http://www.mozilla.org/projects/security/components/signed-scripts.html Can you elaborate on what you want to do?

I read the question as "How do I grab the contents from a file chosen using a file upload field and process it on the client without involving a backend/webserver". I am thinking UniversalBrowserRead access for FF and HTA filesystem for IE for example

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜