Jump to content

reload problem after download script


champoi

Recommended Posts

i have a download list using this script:

 

   $file=$_POST[$_GET['download']];
   header("Content-type: application/force-download");
   header("Content-Transfer-Encoding: Binary");
   header("Content-length: ".filesize($file));
   header("Content-disposition: attachment; filename=\"".basename($file)."\"");
   readfile($file);

 

after the user clicks a download link, i want to reload the page and show what the user has already downloaded by changing the background of the link. But the problem is the reload every after a download click,

 

i tried placing a javascript reload but didnt work, the page just stops without reloading, same when redirecting using javascript,

 

i tried using php header, like this:

 

   $file=$_POST[$_GET['download']];
   header("Content-type: application/force-download");
   header("Content-Transfer-Encoding: Binary");
   header("Content-length: ".filesize($file));
   header("Content-disposition: attachment; filename=\"".basename($file)."\"");
   readfile($file);
   header("Location: ?option=sapli&user=".$_SESSION['uname']."");

 

but it reloads first before the download even starts,

 

any comments and suggestions? :o

Link to comment
https://forums.phpfreaks.com/topic/134527-reload-problem-after-download-script/
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.