Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
For this piece of code below:
C#
var fso = new ActiveXObject("Scripting.FileSystemObject"); 

Got
C#
JavaScript runtime error: Automation server can't create object
In my IE Tools' security setting, I did Enable the Initialize and script Activex controls not marked as safe for script option.

How can this problem be eliminated? Thanks.
Posted
Updated 12-Jan-16 9:17am
v2
Comments
ZurdoDev 12-Jan-16 16:29pm    
FYI, this code will only work in IE, not chrome or firefox, and will only work when you lower the security level enough.
DeDenker 13-Jan-16 5:57am    
This code suggest you want to access the local drive, big change the webserver is not allowing this.
Unless this is internal use like a webbased file explorer, no body in there right mind will allow this to run on there computer.

What are you trying to accomplish?
s yu 13-Jan-16 6:46am    
JK and Ryan: Thanks to both of you for your responses. In my project, I need to upload some files into a shared folder in server using FileLoad in an aspx file. This is my JS version to check if the file exists. Since it is security-sensitive, I might to consider something alternative. Thanks again.

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