View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
Probably the easiest and most efficient solution is to use obscure file names by using a combination of the SYS(2015) function and possibly a string that is unique to each user.  This will make file names impossible to guess.  Save the files in a Web-accessible directory, which is cleared at regular intervals (once a day?), by a separate program.  This program should keep all files that were created in the previous hour or so.

FoxWeb Support Team email

Sent by Alan Harris-Reid on 07/08/2002 01:57:50 PM:

My website allows a user to extract data to create a number of spreadsheet files, which are then zipped-up into a uniquely-named self-extracting .exe file which the user can download onto their pc (hopefully immediately).  Because each file will be unique to that user, I would like it to be deleted from the server once downloaded.  How can I arrange this from within my script files?
Because of the stateless nature of the web I don't think I can interrupt script execution while the file downloads, then delete the file programmatically.  Can I?
I guess I could run a batch file via the Windows scheduler to regularly clear-out the download folder, but is there any way I can fire a Foxpro program (perhaps via. a timer control) while the channels are waiting for a web-hit?  Alternatively, can I set a program to run just before the session.timeout takes effect?
Any help would be appreciated.