Discussion Locked

Server/Client side script file delete?

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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 www.triplewmall.com site to see how the enterstore.asp page works

6 replies

by bojidar alexandrov

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.

by 3wadman

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.

by 3wadman

(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)

by jay eckles

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

You'd probably want to put this as the last thing before

by 3wadman

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.

This discussion is closed to new replies.