open local file with XMLHTTPRequest/ActivcXObject

A

acord

Hi,

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

Thanks
Sam
 
A

Alex

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.
 
J

Julian Turner

acord said:
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
 
R

Randy Webb

Julian Turner said the following on 3/21/2006 3:22 AM:
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.
 
A

Alex

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.
 
R

Randy Webb

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top