[Javascript] client side file i/o
Vadiraj C S
vadiraj at mail.cyberneme.com
Tue Jun 15 06:17:45 CDT 2004
I've tried all the possibilities, nothing seems to work even
with signed script.
The scripts throws
JavaScript Error: uncaught Java exception
netscape/security/ForbiddenTargetException("User didn't grant the
UniversalFileRead privilege.")
IF I use netscape.security.PrivilegeManager.enablePrivilege(["targetName"])
it gives permission denied if I dont use this.
> With this all I got was a "Permission Denied", but if you said that you
> have a way to allow your script to access local drive, then try this:
>
> <script>
> var oRequest;
>
> if(document.all) {
> // Internet Explorer
> oRequest = new ActiveXObject("Microsoft.XMLHTTP")
> }
> else {
> // Mozilla
> oRequest = new XMLHttpRequest();
> }
>
>
> oRequest.open("GET", "file:///C:/myLocalFile.txt", false);
> oRequest.send(null);
> textToBeWritten = oRequest.responseText;
>
> document.write(textToBeWritten);
> </script>
>
This also gives the same error.
I've referred this link,
http://developer.netscape.com/viewsource/goodman_sscripts.html
could any find some solution on this?
Thanks in advance.
--
regards
Vadiraj C S
More information about the Javascript
mailing list