Jump to content

forced download.


spires

Recommended Posts

Hi,

Does any one know why:
when i click a link to download (page1)
the link throws me to the download page (page2 see * code)
then throws me back to page one?

even if i:
click a link to download (page1)
throws me to a jump page (page2). which, using a header location
throws me to the download page (page3 see * code)
then throws me back to page one?

why does it always comeback to page one?

thanks for any help on this.  :)

*[code]
$dir = '../cart/mp31/';
$file = $dir.$_REQUEST['userfile_name1'];

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-length: '.filesize($file));
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($file));

header( "Content-Description: File Transfer");
@readfile($file);
[/code]

Link to comment
https://forums.phpfreaks.com/topic/17975-forced-download/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.