Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Javascript problem

Javascript problem

Scheduled Pinned Locked Moved Web Development
helpjavascriptsysadmintestingtools
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chetan Ranpariya
    wrote on last edited by
    #1

    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.

    P 1 Reply Last reply
    0
    • C Chetan Ranpariya

      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.

      P Offline
      P Offline
      Pradyumna Gogte
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • P Pradyumna Gogte

        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

        C Offline
        C Offline
        Chetan Ranpariya
        wrote on last edited by
        #3

        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.

        P 1 Reply Last reply
        0
        • C Chetan Ranpariya

          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.

          P Offline
          P Offline
          Pradyumna Gogte
          wrote on last edited by
          #4

          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

          C 1 Reply Last reply
          0
          • P Pradyumna Gogte

            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

            C Offline
            C Offline
            Chetan Ranpariya
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups