Delete file after download

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
 
W

William LaMartin

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.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top