Close and destroy a file

Results 1 to 2 of 2

Thread: Close and destroy a file

  1. #1
    Join Date
    Dec 1969

    Default Close and destroy a file

    Hi, what i want to do is in the same time that user close a window, the file that was showing in browser must be destroyed (deleted). How can i do this?<BR>Best Regards,<BR>Cristovao

  2. #2
    Join Date
    Dec 1969

    Default RE: Close and destroy a file

    It&#039;s hard.<BR><BR>You cannot accurately trap the event of a browser window closing.<BR><BR>You could try the body onUnLoad event handler. If you open a new window which hits an ASP page with the name of the file being shown. That ASP page could then delete the file and write back some JavaScript to the client user to close the popup window.<BR><BR>Other than that, you could store all of the documents which the user is viewing in a string in a session variable and use the Session_OnEnd subroutine to iterate through the documents in that string and to delete them. This will be 20 minutes after the last request for an item from the server, however, not when they close their browser. There have even been reports of that subroutine not firing for some users at all.<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts