Javascript problem
-
Hey friends, I have a problem related javascript. I am trying to create "scriting.filesystemobject" using javascript but I am getting the error "automation server can not create object" Plz send me the solution i any of u have it. Thank u all.
-
Hey friends, I have a problem related javascript. I am trying to create "scriting.filesystemobject" using javascript but I am getting the error "automation server can not create object" Plz send me the solution i any of u have it. Thank u all.
There could be host of reasons for this error. For example no scripting engine is installed on your machine or you do not have permissions to access the filesystemobject, or you do not have permissions to open the necessary files. Are you doing this as a part of your web page? also what os are you using. a lot depends on this too. Prady
-
There could be host of reasons for this error. For example no scripting engine is installed on your machine or you do not have permissions to access the filesystemobject, or you do not have permissions to open the necessary files. Are you doing this as a part of your web page? also what os are you using. a lot depends on this too. Prady
Hi, Thank u very much for the reply. I am using windows2003 server and developing a web application using ASP.NET and Web server is IIS of my system. I want to make .txt files on server using javascript. For that I am doing like this. fso =new ActiveXObject("Scripting.FileSystemObject"); f = fso.CreateTextFile(filename, ForReading); f.Write(myRTF.document.body.innerHTML); f.close(); Do u have solution of this problem. If u have it then plz sent it to me. Thank u again.
-
Hi, Thank u very much for the reply. I am using windows2003 server and developing a web application using ASP.NET and Web server is IIS of my system. I want to make .txt files on server using javascript. For that I am doing like this. fso =new ActiveXObject("Scripting.FileSystemObject"); f = fso.CreateTextFile(filename, ForReading); f.Write(myRTF.document.body.innerHTML); f.close(); Do u have solution of this problem. If u have it then plz sent it to me. Thank u again.
Hi Chetan, Hello! there is a better way to do this. If you are using ASP.Net and want to create the files on the server then why are you using JavaScript? you could use C# code behind for a much richer functionality. However that is your choice. The problem you are facing is due to permissions. Your JavaScript is not getting permission to write the file, which is what it is designed to do by default. You will have to change the web conf file for your project to grant permission to access the disk resource. Only then can you write to a file. Prady
-
Hi Chetan, Hello! there is a better way to do this. If you are using ASP.Net and want to create the files on the server then why are you using JavaScript? you could use C# code behind for a much richer functionality. However that is your choice. The problem you are facing is due to permissions. Your JavaScript is not getting permission to write the file, which is what it is designed to do by default. You will have to change the web conf file for your project to grant permission to access the disk resource. Only then can you write to a file. Prady
Thank u very much for ur reply, The way u suggested that to use code behind to create file on server is very right but in my application it is mandatory to create it by javascript. and u said that there could be a problem reagrding permissions, thats right. I also tried for that but could not get proper solution. actually It was performing in fine way just berofre two days. but now it not working. Thank u again for ur suggestion and the way u suggested.