开发者

Read a local file

开发者 https://www.devze.com 2022-12-25 06:48 出处:网络
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 granti

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

0

精彩评论

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