[Javascript] client side file i/o

Flavio Gomes flavio at economisa.com.br
Mon Jun 14 09:59:46 CDT 2004


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>

---
Flavio Gomes
flavio at economisa.com.br



Cutter (JavaScript List) wrote:

> Vadi,
>
> To my knowledge, this is not capable using javascript. I have never 
> seen any documentation allowing javascript access into the client 
> system outside of the browser. If you were only using Windows and IE 
> you would be able to use JScript (an MS scripting language, similar to 
> javascript), but I see this would not meet your requirements. There 
> are too many security concerns to allow a browser scripting language 
> access to a client system...
>
> Cutter
>
> Vadi wrote:
>
>>
>>  Hello List!!
>>
>>   I'm newbie, I'm trying to read a file from the local drive at 
>> client  machine.
>> This is not allowed by default, but it allows us to do with signed 
>> applets,
>> loading a signed applet takes time, I was wondering If there is a way to
>> read local files without applets and without using ActiveXObjects, as I
>> want to make it platform dependent.
>>
>>  I'm working with respect to netscape, IE is not considered. Help is  
>> required
>> immediate.
>>
>>  Thanks in advance.
>>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list