Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // check security, get filename from request, prefix document download directory and check for file existance then...
- header('Content-Type: application/pdf');
- header('Content-Disposition: attachment; filename="' . basename($file) . '"');
- header('Content-Transfer-Encoding: binary');
- header('Content-Length: ' . filesize($file));
- header('Connection: Close');
- set_time_limit(0);
- readfile($file);
- http___example.com_index.php_page=secure_area_download&file=protected.pdf
- index.php?page=secure-area/download&file=document.pdf
- file/secure-area/download/document.pdf
- RewriteEngine On
- RewriteRule ^file/secure-area/download/(.*)$ index.php?page=secure-area/download&file=$1 [L]
- // check security, get filename from request, prefix document download directory and check for file existance then...
- header('Content-Type: application/pdf');
- header('Content-Disposition: inline; filename="' . basename($file) . '"');
- header('Content-Transfer-Encoding: binary');
- header('Content-Length: ' . filesize($file));
- header('Connection: Close');
- set_time_limit(0);
- readfile($file);
- document.pdf
- http___example.com_index.php_page=secure_area_download&file=document.pdf
- Content-Disposition: inline;
Add Comment
Please, Sign In to add comment