Access Denied error while opening file in JavaScript

Silas Njoroge picture Silas Njoroge · Nov 22, 2010 · Viewed 7.6k times · Source

When I try to open window.open('file///C:\calendar.html') it throws

Access Denied error

How do I fix this? Thanks

Answer

Ioan Alexandru Cucu picture Ioan Alexandru Cucu · Nov 22, 2010

Usually you'll won't be allowed to open files from the client's filesystem as this would pose a huge security hole. No browsers would allow it.

You could use signed scripts to do that. For a detailed description check: http://www.mozilla.org/projects/security/components/signed-scripts.html This is of course browser specific.