Not exactly. You have the access to those local files that the user has requested/selected. You will never be permitted to freely wander around user's actual local filesystem. Ther is, however, a draft specification of File API which allows a javascript application to create it's own 'sandboxed' filesystem, with files and directories. See the spec (http://dev.w3.org/2009/dap/file-system/file-dir-sys.html) and a good article (http://www.thecssninja.com/javascript/filesystem) on implementation. Already works in latest stable Chrome and perhaps FF4 beta (didn't test though).
-- Best regards, Dmitriy Pashkevich. Mon, 6 Dec 2010 10:31:13 +0800 письмо от Discussion of JavaScript <[email protected]>: But I just access local files from other local files, neither I can do it?or should I build a local server and access files through "http://localhost" ? 2010/12/6 Discussion of JavaScript <[email protected]> You CANNOT access arbitrary local files from javascript! Sunday, December 5, 2010, 7:30:26 PM, you wrote: BTW, I know in firefox I can use "try...catch" to implement what I want, but is it "good" solution? And I can do nothing in Chrome... On Mon, Dec 6, 2010 at 12:21 AM, Yu-Hsuan Lai <[email protected]> wrote: I guess that XMLHttpRequest can work on this issue, but this code: --- xmlHttp.open("GET", "01.swf", false); xmlHttp.send(); return xmlHttp.status == 0; --- totally can't work in Chrome(though "01.swf" exactly exists, I get "ETWORK_ERR: XMLHttpRequest Exception 101"). In Firefox, it works if "01.swf" exists. If not, I get "Access to restricted URI denied" code: "1012". I believe javascript can know whether a file exists, but how? -- Lai, Yu-Hsuan -- Lai, Yu-Hsuan -- Best regards, Dmitriy Pashkevich mailto:[email protected] _______________________________________________ JSMentors mailing list [email protected] http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com -- Lai, Yu-Hsuan _______________________________________________ JSMentors mailing list [email protected] (sentmsg?compose&[email protected]) http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com (http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com)
_______________________________________________ JSMentors mailing list [email protected] http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com
