Is there no way for javascript hosted on a webserver to read a 开发者_如何学Gofile on a client's local machine? (this has obvious security risks). I guess I'm wondering if there's any access granting a user can do, like drag and dropping a file into the browser, or explicitly selecting a file from a popup to get around this?
I know flash 10 allows reading of a local file, just wondering if there were any method to do this in javascript.
Thanks
... or explicitly selecting a file from a popup to get around this ...
You could of course just upload the file to your server then...
Who on their right mind would release a browser that let JS to... oh wait, you can with activeX, but only works with IE.
There is new File API being a working draft in W3C, and it is already implemented in Firefox 3.6, see
http://demos.hacks.mozilla.org/openweb/FileAPI/
http://ajaxian.com/archives/w3c-publish-first-working-draft-of-file-api
http://hacks.mozilla.org/2009/12/w3c-fileapi-in-firefox-3-6/
Nope, that's not possible...
However, see this:
http://www.mozilla.org/js/js-file-object.html
精彩评论