I have this part of a code that generates a image file and send it to the browser to open / download.
When the user opens the file, automaticallt the script unlinks 9deletes) the file. So what's tje worry? if the user DOESN'T do anything or cancels file transfer, the file stays!! I want to prevent this because it's a temp file.
Sosmebody?
case 'convert':
$path = "c:/temp/";
$gebruiker="gast";
$time=time().smarteye;
$image="motor.jpg";
$convert=$convert=`convert $image $time.$format`;
$bestandsnaam= $time.".$format";
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . $bestandsnaam . '"');
readfile("$bestandsnaam");
unlink ("$bestandsnaam");
break;