httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jenkins, David" <david.e.jenk...@citigroup.com>
Subject RE: [users@httpd] How to delete a file after it's been served?
Date Sat, 14 Sep 2002 16:05:14 GMT
If the file isn't html (or script) a cron job as mentioned previously that
greps the logs for the file could do the job (filename uniqueness would
eliminate errors in deleting at the wrong time).

Just a thought.

> -----Original Message-----
> From: goofus@cheapgurus.com [mailto:goofus@cheapgurus.com]
> Sent: Saturday, September 14, 2002 06:38
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] How to delete a file after it's 
> been served?
> 
> 
> 9/13/02 4:56:44 PM, Brian Doyle <lists@balancesoftware.com> wrote:
> 
> >Thanks but this doesn't meet my criteria...  I know how to 
> delete a file, I
> >guess I'm more interested in being notified that the file 
> has been served.
> >
> >In other words, can apache signal me somehow (with the 
> filename preferably)
> >so that I can then delete the file.
> >
> >Thanks,
> >
> >Brian
> >
> >On 09.13.02 2:43 PM, "Jacob Coby" <jcoby@listingbook.com> wrote:
> >
> >>> Can anyone tell me how to delete a file from the server 
> immediately after
> >>> it's been served?
> >>> 
> >>> I'd like to serve a client-specfic file (created in a 
> temporary directory
> >> by
> >>> a CGI) then delete it once it's been served.
> >> 
> >> depends on the language.  most have an unlink() or exec() 
> function that will
> >> do what you want.  You have to have permissions to delete 
> it though.
> >> 
> >> Another option is to cron a job to clean up the directory 
> every 10 min or
> >> so.
> >> 
> >> -Jacob
> >> http://www.listingbook.com
> >> 
> >> 
> 
> 
> Hi, Brian!
> 
> Assuming that the client-specific file is some form of HTML 
> document, and since it's already being created by a 
> CGI, here's what I'd do.
> 
> 1. Have the creating CGI - which obviously knows the name of 
> the file it is creating - write a line just before the 
> closing body tag that looks like this:
> 
> <!--#include virtual="/cgi-bin/eraser.cgi?served=clientfilename" -->
> 
> 2. Create eraser.cgi to delete the file, maybe logging some 
> info about when served, and outputting a thank you, 
> copyright notice, disclaimer, or maybe a brief message to the 
> client to remind them that now that they've seen 
> it, it's gone. Or the eraser could email you that such and 
> such file was served, etc. It could do just about 
> anything.
> 
> Of course, if it's some other type of file, it's a different 
> problem, but maybe this will give you some ideas.
> 
> Cindy
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message