Javascript - loadfromfile

I have coldfusion page on a remoteserver and in that i have javascript that loads a file from local machine into server.

code i have -

var adoStream = new ActiveXObject("ADODB.Stream");
//adoStream.Mode = 1; // read only , 3 read write
adoStream.Type = 1; // adTypeBinary
adoStream.LoadFromFile(filename); <--- THIS IS WHERE THE ERROR

Load from file does not work

The remote server is in the Intranet Zone (added through security
settings), and "Access data sources across domains" is set to Enable in
Miscellaneous Security Settings.

I have also added that intranet website to trusted sites...

Pl help

Who is Participating?
b0lsc0ttConnect With a Mentor IT ManagerCommented:

What is the browser and version of the browser?

What does the path of the filename look like?  In the URL in the browser's address bar what is the protocol?  If http: then is it localhost, an IP or what?

Is it an option to run the file locally or does it need some of the ColdFusion script?  I think what you are trying to do just won't work in the browser.  The version may matter and you might be able to mess the security settings up to force it but I am not even sure that is an option.  I need some more details to know for sure but that error message makes me think this is something that just won't work.

An exception would be if you could run the Javascript in a local page that has the .hta extension.  Those HTML Application files have looser security settings and are more trusted, especially regarding what you are trying to do.

Let me know if you have any questions or need more information.

Now, I just have to ask?
You have changed the  code from
objStream.LoadFromFile "C:/Guru/Meditation/Chant17.txt"

Look this style with the acctual file.
objStream.LoadFromFile "C:/Guru/poop/ant17.txt"

Open in new window

Correcting my self

objStream should not of been changed  adoStream
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

selvolConnect With a Mentor Commented:


Well you can go through the steps that were  taken 3 years ago.

When this exact question was posted VERBATIM~.

I just have to ask...

at999Author Commented:

thanks for the reply, i cannot try the steps you have recommended, since ei will have to make lot of changes to the code to do that.

When i do loadfromfile i get error - 'Safety Settings on this computer prohibits accessing datasourcea across domains.  
i still get errors pl help
at999Author Commented:
i found the solution , since i was accessing c:\temp of my machine, i had to add url://c:\temp to my trusted websites in my internet explorer browser and also i checked - access data across doman  
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.