dhillarun Posted March 7, 2007 Share Posted March 7, 2007 Hi everbody, I am displaying "Save-As" dialogue box header("Cache-Control: public, must-revalidate"); header("Pragma: hack"); header("Content-Type: " . $this->mime); header("Content-Length: " .(string)($fsize) ); header('Content-Disposition: attachment; filename="'.basename($this->path.$this->name).'"'); header("Content-Transfer-Encoding: binary\n"); using "header()" function. But how to know that user has clicked "save" button or "cancel" button. Pl do reply me. Link to comment https://forums.phpfreaks.com/topic/41577-how-to-get-return-status-of-save-as-dialogue-box/ Share on other sites More sharing options...
fert Posted March 7, 2007 Share Posted March 7, 2007 you can't Link to comment https://forums.phpfreaks.com/topic/41577-how-to-get-return-status-of-save-as-dialogue-box/#findComment-201478 Share on other sites More sharing options...
dhillarun Posted March 7, 2007 Author Share Posted March 7, 2007 I am sending the content to the browser as chunks by chunks by using the following function. I tried to check whether no. of bytes sent to browser is equal to original file size. But it's not working. Pl specify any other better way to achieve the same. (i.e)I want to know success or failure in delivery of whole downloading file . function readfile_chunked($filename) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $cnt =0; $handle = fopen($filename, 'rb'); if ($handle === false) { return 0; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); if(print $buffer) { $cnt += strlen($buffer); } } fclose($handle); return $cnt; } Link to comment https://forums.phpfreaks.com/topic/41577-how-to-get-return-status-of-save-as-dialogue-box/#findComment-201484 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.