Deleting file

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,

In my web application I have to let users to download
files from web server.

How can track or find out that a file was downloaded so I
can delete it from web server?

I'm coping file to a web server from shared drive and I
have several web servers behind load balancer so if user
won't dowload file in his current session next time he may
be on the other web server.
I can run a windows service to check file creation time an
delete it if it's let's say more then 5 hours ago. But I
was wondering is there better way to handle this?

Thanks
Mark
 
Hi Mark,

Make an ASPX page through which the users will donwload the file, instead of
pointing them directly to the file. For instance:
/appli/download.aspx?file=myfile.doc

That way you know exactly when the file is downloaded.
 
Hi ,
Thanks for reply.
Sorry, can you give me more details I don't understand.
What happens on another page when it's called?
Should I read file to a stream, then write it to response
stream and when finished consider file downloaded?

Thanks
Mark
 
Back
Top