Delete file after download

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

Hi.
In my application I'm handling sensitive files. I copy them from a file
server and onto the webserver, but I have to delete them again as soon as
the user is finished with his download. Is that possible? Is there some
way to detect when the download is finished? And if so I'm guessing that I
can't use response.redirect ot server.transfer because then the delete code
will never run... Any ideas?

Thanks,
Shawn
 
Instead of transferring the file to the server, is it possible to just read
it into a memory stream and then response.binarywrite this memory stream to
the client's browser? With the response.content set correctly, this should
allow a download to the client's computer.
 
Record the file paths in Session when the user downloads them, and delete
them all in the Session_End Event Handler.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top