Page 1 of 1

header

Posted: Thu Apr 15, 2004 2:53 pm
by dizeta
hi,

i have a link
example:
<a href="download.php?action=download&Id={$nome['id_pdf']}"</a>

how i have to use header to open a pdf file into browser and msword file without download it?

thanks

Posted: Thu Apr 15, 2004 4:16 pm
by Slippy
I think you need to use content type headers so that the browser knows what file type it is and then it can handle it accordingly. Is it that you don't want the user to be prompted to "Save or Open?"

Code: Select all

<?php
header("Content-Disposition: filename=".$row&#1111;"outline_filename"]);
header("Content-Type: ".$row&#1111;"outline_filetype"]);
header("Content-Transfer-Encoding: binary");

?>
The outline_filename refers to the filename that you want, the filetype is a mimetype such as image/pjpeg or application/pdf

That might help?