Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > open local file with XMLHTTPRequest/ActivcXObject

Reply
Thread Tools

open local file with XMLHTTPRequest/ActivcXObject

 
 
acord
Guest
Posts: n/a
 
      03-20-2006
Hi,

Can anyone tell me how to use XMLHTTPRequest or MS ActivcXObject open a
local file?

Thanks
Sam
 
Reply With Quote
 
 
 
 
Alex
Guest
Posts: n/a
 
      03-21-2006
I have posted a week, week and a half code for Firefox, getting text
and writing to a local file. Search by my name. There are plenty
examples for IE through google web search.

 
Reply With Quote
 
 
 
 
Julian Turner
Guest
Posts: n/a
 
      03-21-2006

acord wrote:

> Hi,
>
> Can anyone tell me how to use XMLHTTPRequest or MS ActivcXObject open a
> local file?
>
> Thanks
> Sam


With regard to HTTPRequest (assuming it is running in a browser, and
security settings allow), just set the URI to the local file path, and
then read the text of the file using the responseText property.

With the ActiveXObject, look up the various objects and properties of
Scripting.FileSystemObject on the msdn website
<URL:http://msdn.microsoft.com>

Regards

Julian Turner

 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      03-21-2006
Julian Turner said the following on 3/21/2006 3:22 AM:
> acord wrote:
>
>> Hi,
>>
>> Can anyone tell me how to use XMLHTTPRequest or MS ActivcXObject open a
>> local file?
>>
>> Thanks
>> Sam

>
> With regard to HTTPRequest (assuming it is running in a browser, and
> security settings allow), just set the URI to the local file path, and
> then read the text of the file using the responseText property.


And then, only if it is running from the local file system. If the page
is on a server, you won't read the file.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
Alex
Guest
Posts: n/a
 
      03-21-2006
Well, not true. I can show how you can bypass that in userl.js for YOUR
browser. Other users will not be able to, not without additional
entries to user.js, but for your OWN needs, you can make it read YOUR
files by setting permissions, it will never even prompt you.

 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      03-21-2006
Alex said the following on 3/21/2006 9:01 AM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >

> Well, not true.


Yes, it is true.

> I can show how you can bypass that in userl.js for YOUR browser.


My IE does not have a userl.js file so that will be hard to show me.

> Other users will not be able to, not without additional
> entries to user.js, but for your OWN needs, you can make it read YOUR
> files by setting permissions, it will never even prompt you.


If you want to do that, run the file locally and you don't even have to
edit anything.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: how to open a file in some application using Tkinter i am usingTKINTER to create GUI application i want to know how to open a worddocument in open office or any other applicatio Fredrik Lundh Python 1 01-09-2008 10:40 AM
File::open and File.open Schüle Daniel Ruby 4 10-24-2006 09:34 PM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
Browser link to local file works when local, not work when servedfrom http lurker HTML 1 04-05-2005 05:10 AM



Advertisments