FileSystemObject

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Cummings

    FileSystemObject

    I have inherited form that requires me to use the FilesystemObjec t to
    write to a file. I have to use Javascript to instantiate and use the
    object. I think that I am having a problem as far as getting the
    javascript to work server side. I am able to create a file and write
    to it locally but when trying to work it on the server, I get
    Unspecified Error. I thought that possibly using <script
    language="javas cript" runat="server"> would take care of that. But it
    says objected expected when I have thte runat=server in there. It
    doesn't even recognize the function. Any ideas on how i can run the
    following code onSubmit using Javascript? I had it done in vbscript
    but the client insists that it be done using Javascript. Please
    help!!!!!

    Yemi

    function getEmailList()
    {
    var fso = new ActiveXObject(" Scripting.FileS ystemObject");
    var newfile = fso.OpenTextFil e("d:/inetpub/www.lottery.sta te.az.us/database/textfiles/textfile.txt",
    8,true);
    newfile.WriteLi ne("It works.");
    newfile.Close() ;
    }
  • Tim Williams

    #2
    Re: FileSystemObjec t

    Does the server have any antivirus software installed? Norton is famous for
    causing problems with this kind of script: if you have it then you might
    look into disbling the "script blocking" feature.

    tim

    "John Cummings" <suavipapi@hotm ail.com> wrote in message
    news:85ed5b3.03 06271045.4e7559 73@posting.goog le.com...[color=blue]
    > I have inherited form that requires me to use the FilesystemObjec t to
    > write to a file. I have to use Javascript to instantiate and use the
    > object. I think that I am having a problem as far as getting the
    > javascript to work server side. I am able to create a file and write
    > to it locally but when trying to work it on the server, I get
    > Unspecified Error. I thought that possibly using <script
    > language="javas cript" runat="server"> would take care of that. But it
    > says objected expected when I have thte runat=server in there. It
    > doesn't even recognize the function. Any ideas on how i can run the
    > following code onSubmit using Javascript? I had it done in vbscript
    > but the client insists that it be done using Javascript. Please
    > help!!!!!
    >
    > Yemi
    >
    > function getEmailList()
    > {
    > var fso = new ActiveXObject(" Scripting.FileS ystemObject");
    > var newfile =[/color]
    fso.OpenTextFil e("d:/inetpub/www.lottery.sta te.az.us/database/textfiles/text
    file.txt",[color=blue]
    > 8,true);
    > newfile.WriteLi ne("It works.");
    > newfile.Close() ;
    > }
    >[/color]


    Comment

    • John

      #3
      Re: FileSystemObjec t

      "Tim Williams" <saxifraxREMOVE @THISpacbell.ne t> wrote in message news:<hfqLa.423 7$mC2.2099@news svr16.news.prod igy.com>...[color=blue]
      > Does the server have any antivirus software installed? Norton is famous for
      > causing problems with this kind of script: if you have it then you might
      > look into disbling the "script blocking" feature.
      >
      > tim
      >
      > "John Cummings" <suavipapi@hotm ail.com> wrote in message
      > news:85ed5b3.03 06271045.4e7559 73@posting.goog le.com...[color=green]
      > > I have inherited form that requires me to use the FilesystemObjec t to
      > > write to a file. I have to use Javascript to instantiate and use the
      > > object. I think that I am having a problem as far as getting the
      > > javascript to work server side. I am able to create a file and write
      > > to it locally but when trying to work it on the server, I get
      > > Unspecified Error. I thought that possibly using <script
      > > language="javas cript" runat="server"> would take care of that. But it
      > > says objected expected when I have thte runat=server in there. It
      > > doesn't even recognize the function. Any ideas on how i can run the
      > > following code onSubmit using Javascript? I had it done in vbscript
      > > but the client insists that it be done using Javascript. Please
      > > help!!!!!
      > >
      > > Yemi
      > >
      > > function getEmailList()
      > > {
      > > var fso = new ActiveXObject(" Scripting.FileS ystemObject");
      > > var newfile =[/color]
      > fso.OpenTextFil e("d:/inetpub/www.lottery.sta te.az.us/database/textfiles/text
      > file.txt",[color=green]
      > > 8,true);
      > > newfile.WriteLi ne("It works.");
      > > newfile.Close() ;
      > > }
      > >[/color][/color]


      I see that the client does not insist of JavaScript, but instead
      favors using anything but VB trash. The answers to this are well
      documented. Try the HTTP protocol this month.

      Comment

      Working...