|
Posted by Erwin Moller on 09/01/06 13:17
Collector wrote:
>
> Hi guys,
>
> Is there any way how to delete a file after download headers have been
> sent? This code does not work for some reason.
>
> header('Content-type: application/xml');
> header('Content-Transfer-Encoding: binary');
> header('Content-length: '.filesize($f));
> header('Content-Disposition: attachment; filename="'.basename($f).'"');
>
> if($fp = fopen($f, "rb"))
> {
> while ($buffer = fread($fp, filesize($f))) print $buffer;
> fclose($fp);
> }
>
> unlink($f);
>
>
Can you unlink the file anyway?
I seriously doubt the headers are influencing this...
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|