/ Published in: PHP
This lets you serve up a file for download without revealing the actual URL of the file. Useful for protected downloads or dynamic content coming from a database. The first header() line isn't always needed. It's just there to help Acrobat on Windows behave properly. If you're not returning PDFs, you can (usually) safely remove it.
Expand |
Embed | Plain Text
function download_document($filename, $path = "", $mimetype = "application/octet-stream") { }
You need to login to post a comment.
