Categories

Download content from your site

If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the » Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');
 
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
 
// The PDF source is in original.pdf
readfile('original.pdf');
?>

Learn more

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

IMPORTANT! To be able to proceed, you need to solve the following simple math (so I know that you are a human) :-)

What is 14 + 7 ?
Please leave these two fields as-is: