Web Analytics Made Easy -
StatCounter question about FileSystemObject - CodingForum

Announcement

Collapse
No announcement yet.

question about FileSystemObject

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • question about FileSystemObject

    I am using Scripting.FileSystemObject to save file to my hard disk,
    my browser is IE6.0 and the code is like the following,
    try{
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var tempFile = fso.CreateTextFile('c:\\test.txt', true);
    tempFile.WriteLine("this is a test");
    tempFile.Close();
    }
    catch(err){
    alert(err.description);
    }
    a button click event is used to trigger that saving procedure,
    first time when I clicked the button, a warning dialog jumped out to tell me activeX is trying some unsave operation and asked if I will permit it, then I found if I clicked yes to continue, no problem, the file will be saved correctly, but if I clicked no to cancel the saving process, an error message "automation server can't be created" will get out and from then on, the file saving failed everytime with the same error "automation server can't be created", unless I reopened that page once again
    my question is without reopening the page, is there some way else to solve the problem, I appreciate your help very much!

  • #2
    Just this:
    HTML Applications (Internet Explorer)
    hmm... ?

    Comment


    • #3
      thank you! but maybe it's not what I want, for if I change my
      .htm to .hta, there will be many other new trouble with it.
      in my sense, when I clicked the NO button of the IE's warning
      dialog, I might also have changed some settings about IE's security, which caused the following saving problem. but I dont
      know if it's possible to restore the settings.

      Comment


      • #4
        If you want to restore the settings... either refresh the browser, or reopen the document, and stop clicking the "No" button when the ActiveX security warning promps you. If you don't want a security warning, use an HTA.

        If you're saying that you accidentally opened the Internet Options Panel, and changed your security settings... go back and change them to default.

        Beyond that, there's not much else that I'd recommend.
        hmm... ?

        Comment


        • #5
          thank you, I see what you mean, but it's disappointing that I have to refresh the page to solve the problem

          Comment


          • #6
            That's why you need to use HTA to get rid of the warning dialog box.
            Glenn
            vBulletin Mods That Rock!

            Comment

            Working...
            X