Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $file = $_GET["filename"];
- $file_name = basename($file);
- header("Content-Type: application/zip");
- header("Content-Disposition: attachment; filename=$file_name");
- header("Content-Length: " . filesize($file)); //added this line
- readfile($file);
- ?>
- <a href="<?php echo $_GET["filename"]; ?>" target="_blank">click here</a>
- Download.php is getting the parameter filename value correctly but says
- Warning: Cannot modify header information - headers already sent by (output started at /home/content/72/11973872/html/filerepairtool/down/download.php:9) in /home/content/72/11973872/html/filerepairtool/down/download.php on line 20
- Warning: Cannot modify header information - headers already sent by (output started at /home/content/72/11973872/html/filerepairtool/down/download.php:9) in /home/content/72/11973872/html/filerepairtool/down/download.php on line 21
- <?php
- include 'file.php';
- ?>
- <?php
- $file = $_GET["filename"];
- $file_name = basename($file);
- header("Content-Type: application/zip");
- header("Content-Disposition: attachment; filename=$file_name");
- header("Content-Length: " . filesize($file)); //added this line
- readfile($file);
- ?>
- <!DOCTYPE html>
- <head>
- <title>Page title</title>
- <body>
- Hello world
- <?php
- $file = $_GET["filename"];
- $file_name = basename($file);
- header("Content-Type: application/zip");
- header("Content-Disposition: attachment; filename=$file_name");
- header("Content-Length: " . filesize($file)); //added this line
- readfile($file);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement