You are here: Re: Delete file after headers sent « PHP Programming Language « IT news, forums, messages
Re: Delete file after headers sent

Posted by Frozen on 09/01/06 09:34

You may need to CHMOD the file (and possibly the containing folder) to
be writable by the script.

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);
>
>
> --
> Collector
> ------------------------------------------------------------------------
> Collector's Profile: http://techiegroups.com/member.php?userid=264
> View this thread: http://www.techiegroups.com/showthread.php?t=115692

 

Navigation:

[Reply to this 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

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