General discussion

  • Creator
    Topic
  • #2130400

    Server/Client side script file delete?

    Locked

    by 3wadman ·

    I need a VBscript or Jscript that can be called from a that will delete a file that was created during the page load using VBscript.

    The ASP page creates a temporary file using the Scripting.FileSystemObject, which the page loads into a Iframe. I can’t find a way to delete the temporary file after the page has finished loading. (Client side can’t talk to Server side.)

    Click on any store on the http://www.triplewmall.com site to see how the enterstore.asp page works

All Comments

  • Author
    Replies
    • #3549810

      Server/Client side script file delete?

      by bojidar alexandrov ·

      In reply to Server/Client side script file delete?

      You cant do this in this way. Check also this case – page is loaded, eventualy file is deleted and after that user wants to refresh contents of the iframe.
      Better approach is to delete temporary files on regular basis – a server side script can be run every hour and delete all files older than 1 hour.

      • #3546418

        Server/Client side script file delete?

        by 3wadman ·

        In reply to Server/Client side script file delete?

        Their must be a way to invoke a server side script based on a page event. I like to take care of all business within each static page. If I had to delete the files, via a maintance page, it must be based on traffic. I think opening a ASP page as an object is the key.

    • #3546415

      Server/Client side script file delete?

      by 3wadman ·

      In reply to Server/Client side script file delete?

      (Here’s a thought) IF I can pass the temporary file name to another iFrame located at the bottom of the page, that iFrame could call a ASP page that will delete the file. The top iFrame should load first. (I’ll try it)

    • #3546413

      Server/Client side script file delete?

      by jay eckles ·

      In reply to Server/Client side script file delete?

      There are a couple of tricks you could use. My favorite is

      You’d probably want to put this as the last thing before . deletefile.asp should delete the file, then return
      Content-type: text/javascript
      Content-length: 0

      Obviously your first ASP could populate the value of “filename”. That would accomodate multiple unique filenames that need to be deleted.
      Good luck.

      Jay
      http://www.jayeckles.com

      • #3546301

        Server/Client side script file delete?

        by 3wadman ·

        In reply to Server/Client side script file delete?

        That’s what I came up with as a solution, except I just added another iFrame at the bottom. Nobody got the points but I have another problem I’ll post next. Check it out! Thanks.

    • #3546300

      Server/Client side script file delete?

      by 3wadman ·

      In reply to Server/Client side script file delete?

      This question was closed by the author

Viewing 3 reply threads