extra files on server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi have a .net web application using crystal reports. I ended up exporting
the reports to the server since I needed to dynamically change the default
name of each. Anyhow just wondering if there is any automatic cleanup
procedure I could impliment to delete files that are a week or more old? The
files are named for example 6_21_2007report1.pdf.
Thanks
 
Hi,
Hi have a .net web application using crystal reports. I ended up exporting
the reports to the server since I needed to dynamically change the default
name of each. Anyhow just wondering if there is any automatic cleanup
procedure I could impliment to delete files that are a week or more old? The
files are named for example 6_21_2007report1.pdf.
Thanks

If you want to make sure that the files are cleaned up on a regular (and
predictible) schedule, you will need to implement something on the
server itself, for example a Windows service. However, often that is not
possible (for example if you use a shared server hosting).

The usual approach for this is to use the Session_End event handler (in
Global.asax) to perform some clean up operation. This way, every time a
session terminates, the files are checked and possibly cleaned. The
downside is that it's possible that you have files older than 1 week on
your server (if noone connects for longer than a week). On the other
hand, if noone uses the application for a week, then the traffic is very
low and it doesn't really matter if files are just sitting on the server.

HTH,
Laurent
 
Back
Top