note 73428 added to function.header

From: Date: Thu, 22 Feb 2007 21:20:03 +0000
Subject: note 73428 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-123724@lists.php.net to get a copy of this message
I'm no experienced php programmer, in fact I started less than 4 months ago...but I've found that to open the save dialog in all browsers I've tried (firefox,navigator, ie6+). firefox and navigator are the most recent versions available as of the date of this message. I am unsure about previous versions. I do not know of any php version compatibility issues. <?php // set the content as octet-stream header("Content-Type: application/octet-stream"); // tell the thing the filesize header("Content-Length: " . filesize("filename.suffix")); // set it as an attachment and give a file name header('Content-Disposition: attachment; filename="filename.suffix"'); // read into the buffer readfile("filename.suffix"); ?> this is converted a bit from code I actually use. I know my code isn't pretty but I've never really been one to follow code-cleanliness standards, although I know I should. If anyone finds any issues with this let me know please so I can correct it, but so far it works for me. I've found that this simplified method will open the save dialog in all of the aforementioned browsers and that they will be able to display progress. I hope this has been helpful. ---- Server IP: 64.71.164.2 Probable Submitter: 151.197.239.172 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/73428 Del: integrated -- https://master.php.net/note/delete/73428/integrated Del: useless -- https://master.php.net/note/delete/73428/useless Del: bad code -- https://master.php.net/note/delete/73428/bad+code Del: spam -- https://master.php.net/note/delete/73428/spam Del: non-english -- https://master.php.net/note/delete/73428/non-english Del: in docs -- https://master.php.net/note/delete/73428/in+docs Del: other reasons-- https://master.php.net/note/delete/73428 Reject -- https://master.php.net/note/reject/73428 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123724) next »