Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/9066757 to your computer and use it in GitHub Desktop.
Save wokamoto/9066757 to your computer and use it in GitHub Desktop.
<?php
$mime_type = 'application/pdf';
$file_path = '/path/to/pdf';
header('Content-Disposition: inline; filename="'.basename($file_path).'"');
header('Content-Length: '.filesize($file_path));
header('Content-Type: '.$mime_type);
readfile($file_path);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment