note 71759 added to function.header

From: Date: Thu, 14 Dec 2006 15:43:04 +0000
Subject: note 71759 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-120609@lists.php.net to get a copy of this message
Notice the differences between following headers 1.) <? header('Content-Disposition: inline; filename="presentation.pdf"'); ?> 2.) <? header('Content-Disposition: attachment; filename="presentation.pdf"'); ?> The second one FORCES the browser (IE, for ex.) to show [Save File As...] dialog. In this (M$ PowerP. Presentation presentation) case, when I click on [Open] button in the dialog, it opens the program and presentation for edit). The first one allows browser to display file "inline". In this case, presentation is displayed on the screen without opening M$ PowerP. Browser does not show [Save File As...] dialog. Note that you need to send proper headers to browser too. Best practice to force browser to show [Save File As...] dialog is this: <? header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="presentation.pdf"'); ?> ---- Server IP: 212.24.129.110 Probable Submitter: 217.169.180.117 (proxied: 1.0 PRA-ISA-01) ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/71759 Del: integrated -- https://master.php.net/note/delete/71759/integrated Del: useless -- https://master.php.net/note/delete/71759/useless Del: bad code -- https://master.php.net/note/delete/71759/bad+code Del: spam -- https://master.php.net/note/delete/71759/spam Del: non-english -- https://master.php.net/note/delete/71759/non-english Del: in docs -- https://master.php.net/note/delete/71759/in+docs Del: other reasons-- https://master.php.net/note/delete/71759 Reject -- https://master.php.net/note/reject/71759 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120609) next »