473,382 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Delete file after download

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
Nov 18 '05 #1
2 5836
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.

"Shawn" <bo********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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.

"Shawn" <bo********@hotmail.com> wrote in message
news:#V**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter A. Schott | last post by:
Got a strange scenario going on here in that I could have sworn this worked yesterday. I am issuing binary retrieval calls to an FTP server, writing to a file, close the file, then removing the...
2
by: John Smith | last post by:
Hello all, I don't know c# that well and thus need urget help. I have a page that displays files from an access database that has a button to be delet file from database. I need a confirmation...
2
by: TOI DAY | last post by:
Hi all, How can I delete the file on the server after the user download it? For example: I have file name "123.txt" on a server, I copy it to "ABC.txt", then allow uer download the...
2
by: Mark | last post by:
Here is what I am hoping to accomplish: 1. Connect to FTP server - I can do this. 2. Download file contained in the directory that I connect to. 3. Delete file contained on the ftp server. 4. ...
9
by: groleo | last post by:
Hi list. Simple question: is it possible to override the global new/delete operators, without using malloc/free? I mean something in the ideea of the code below, which doesnt work cause of...
4
by: Ignoramus6539 | last post by:
There were some strange requests to my server asking for config.php file (which I do not have in the requested location). I did some investigation. Seems to be a virus written in perl,...
0
by: ravirajdanasekaran | last post by:
I have written a web form which downloads files to the client automatically. After the download completes, I would like to delete the file that was downloaded. I can't tell how to wait until the...
2
by: SCPOS | last post by:
Cannot delete X: It is being used by another person or program. Close any programs that might be using the file and try again. Of course I have tried closing any programs I know of that may be...
107
by: bonneylake | last post by:
Hey Everyone, Well for the last few days i been trying to figure out how to delete attachments and download attachments to my computer. The deleting is sort of working and i don't know where to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.