Page 1 of 1

Download check - take 2

Posted: Wed Jan 08, 2003 4:47 pm
by daven
To clarify/reiterate a previous question I had:

Scenario: User clicks link to binary file, and chooses "save". After the file is downloaded, I need to have the server's copy deleted. Thus, I need some way to check to see if the user has downloaded the file.

I am running under FreeBSD, so COM objects are not available.

Any suggestions would be greatly appreciated. I am against a wall.

Posted: Wed Jan 08, 2003 5:00 pm
by Gen-ik
Why don't you just log the time of the download started and then delete the file from your server 1, 2, or even 12 hours later... depending on the size of the file.

Posted: Wed Jan 08, 2003 7:24 pm
by volka
why do you create the file and keep it anyway?
e.g.

Code: Select all

<?php
header('Content-type: text/plain');
header('Content-disposition: attachment; filename=sqrts.txt');
$arr=range(0,10);
$arr=array_map('sqrt', $arr);
print_r($arr);
?>
or

Code: Select all

<?php
header('Content-type: application/octet');
header('Content-disposition: attachment; filename=dirlist.txt');
passthru('ls -lad *');
?>
if you have to invoke an external programm