Reply to Delete file after headers sent

Your name:

Reply:


Posted by Collector on 09/01/06 06:49

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);


--
Collector
------------------------------------------------------------------------
Collector's Profile: http://techiegroups.com/member.php?userid=264
View this thread: http://www.techiegroups.com/showthread.php?t=115692

[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

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