note 106350 added to function.readfile

From: Date: Sat, 29 Oct 2011 23:37:23 +0000
Subject: note 106350 added to function.readfile
Groups: php.notes 
Request: Send a blank email to php-notes+get-184224@lists.php.net to get a copy of this message
An update my previous comment: The 404 errors were occurring because the PHP code was tailored to delete the temporary file after sending it to the client. The deletion works as expected with readfile(), but the same code (the only addition being the x-sendfile header) causes the source file to be deleted mid-download with mod_xsendfile. Lesson learned: Don't attempt to delete a temporary file after a client downloads it if using mod_xsendfile; the file will be deleted immediately after the headers are sent and the client's download will be interrupted with a 404 (because Apache is no longer able to access the file). ---- Server IP: 69.147.83.197 Probable Submitter: 76.179.0.31 ---- Manual Page -- http://www.php.net/manual/en/function.readfile.php Edit -- https://master.php.net/note/edit/106350 Del: integrated -- https://master.php.net/note/delete/106350/integrated Del: useless -- https://master.php.net/note/delete/106350/useless Del: bad code -- https://master.php.net/note/delete/106350/bad+code Del: spam -- https://master.php.net/note/delete/106350/spam Del: non-english -- https://master.php.net/note/delete/106350/non-english Del: in docs -- https://master.php.net/note/delete/106350/in+docs Del: other reasons-- https://master.php.net/note/delete/106350 Reject -- https://master.php.net/note/reject/106350 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184224) next »