Click here to Skip to main content
15,887,300 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
hi all,
I have a website in asp .net.
In that i am accessing local files.
by using following code:

C#
var shellActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
alert(shellActiveXObject.FileExists('C:/temp.txt'))



it is showing me alert when file exists.
it is running fine in IE but not in chrome.
Becoz ActiveX does not work in chrome.
i got some link for accessing local files in chrome.
http://wizard.ae.krakow.pl/~jb/localio.html[^]

but they have given input file control for opening dialog box which i don't want.

Thank a lot.
God bless u..:)
Posted
Updated 10-Dec-12 22:03pm
v2

1 solution

You are correct that ActiveX does not work in chrome, it also does not work in Firefox, Opera, or any other browser apart from IE. The reason why is that ActiveX gives access to the client system to web sources, which is exactly what you are trying to do. Chrome, Firefox etc. do not allow any access to the client system other than to upload a file to the server - and even then you cannot find out the source drive, folder or any other information, so you will have to rethink your whole idea if you want to use any browser other than IE. And even for IE, most browser installations do not accept or run ActiveX controls for security reasons.
 
Share this answer
 
Comments
MAU787 11-Dec-12 4:24am    
Thank a lot for your guidance ..:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900