Solved

Javascript - loadfromfile

Posted on 2009-07-01
6
1,055 Views
Last Modified: 2012-05-07
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.Open();
adoStream.LoadFromFile(filename); <--- THIS IS WHERE THE ERROR
OCCUR

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

Thnks
0
Comment
Question by:at999
  • 3
  • 2
6 Comments
 
LVL 17

Expert Comment

by:selvol
ID: 24760534
Now, I just have to ask?
You have changed the  code from
adoStream.LoadFromFile(filename);
objStream.LoadFromFile "C:/Guru/Meditation/Chant17.txt"


SElvol
adoStream.LoadFromFile(filename);
 

Look this style with the acctual file.

objStream.LoadFromFile "C:/Guru/poop/ant17.txt"

Open in new window

0
 
LVL 17

Expert Comment

by:selvol
ID: 24760562
Correcting my self

objStream should not of been changed  adoStream
 
0
 
LVL 17

Assisted Solution

by:selvol
selvol earned 100 total points
ID: 24760624


????????????????

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

When this exact question was posted VERBATIM~.

www.tech-archive.net/Archive/Windows/microsoft.public.windows.inetexplorer.ie6.browser/2006-08/msg00187.html

I just have to ask...

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:at999
ID: 24766860
selvol,

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
Thnks
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 400 total points
ID: 24767427
at999,

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.

b0lsc0tt
0
 

Author Comment

by:at999
ID: 24824823
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  
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now