Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. $file = file_get_contents('tmp/sample2.pdf');
  2. if($file)
  3. {
  4. header('Content-Type: application/pdf');
  5. header('Content-Disposition: attachment; filename="tmp/sample3.pdf"');
  6. header('Content-Length: ' . strlen($file));
  7. echo $file;
  8. }else
  9. {
  10. echo "File not found";
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement