Reply to Re: Delete file after headers sent

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация