masphp Posted March 29, 2007 Share Posted March 29, 2007 Hi I have some code like : header("Content-type: application/octet-stream"); header("Content-Length: " . filesize("$ffolder/".$_REQUEST['filename'])); header("Content-Disposition: attachment; filename=\"$_REQUEST[filename]\""); readfile("$ffolder/".$_REQUEST['filename']); mysql_query("delete from $table1 where userid='$_REQUEST[userid]'")or die(mysql_error()); So You could know from that code , that it will open browser downlod dialog that has download and cancel button , So If User Click On Download And let the file to download completely , other codes below readfile will run That i Want it But if user click On cancel or terminate download and not allow download the file completely , Script shutted down and below line : mysql_query("delete from $table1 where userid='$_REQUEST[userid]'")or die(mysql_error()); will not execute, So I want Do some thing that in all way that code executed finally if user downloded file completely or not I even add ignore_user_abort(true); and even other way to my code but no one worked for me please help me! And I need deleting the row when he / she downloded file ??? Link to comment https://forums.phpfreaks.com/topic/44770-help-for-php-out-stream/ Share on other sites More sharing options...
DeathStar Posted March 29, 2007 Share Posted March 29, 2007 [ code ][ /code ] Please! Link to comment https://forums.phpfreaks.com/topic/44770-help-for-php-out-stream/#findComment-217362 Share on other sites More sharing options...
masphp Posted March 29, 2007 Author Share Posted March 29, 2007 header("Content-type: application/octet-stream"); header("Content-Length: " . filesize("$ffolder/".$_REQUEST['filename'])); header("Content-Disposition: attachment; filename=\"$_REQUEST[filename]\""); readfile("$ffolder/".$_REQUEST['filename']); mysql_query("delete from $table1 where userid='$_REQUEST[userid]'")or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/44770-help-for-php-out-stream/#findComment-217374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.