Jump to content


Photo

download count and download file in php


  • Please log in to reply
2 replies to this topic

#1 juneshi

juneshi
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 October 2006 - 04:31 AM

HI sir,

  i have a download file, now, when i click download button, it will open a middle php page, this page contain download counts and download file,then return download file.

  download.php -> middle php file (---------)->download.php

my code in middle page:

<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=aaa.exe");

header("Location: download.php");
?>

but, there's no effect in these download code, when i comment the last code, it can download it. how should i do it?
thanks. 

#2 juneshi

juneshi
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 10 October 2006 - 01:01 AM

any one knows?

#3 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 10 October 2006 - 01:22 AM

reverse the logic, download.php,then middle.php. You can't redirect after a header ( download file );. So show download.php with your information, then include a meta refresh that points to middle.php!


me!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users