Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['name'])) {
- $filePath = "pdfurl-guide.pdf";
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename=" . basename(urlencode($filePath)));
- header("Content-Type: application/octet-stream");
- header("Content-Type: application/download");
- header("Content-Description: File Transfer");
- $fp = fopen($filePath, "r");
- while (!feof($fp)) {
- echo fread($fp, 65536);
- flush();
- }
- fclose($fp);
- die();
- }
- ?>
- Please fill out the following form to download:
- <form method="post" action="">
- Name: <input type="text" name="name" /><br />
- <input type="submit" />
- </form>
Add Comment
Please, Sign In to add comment