file download....

A

Anonymous

Guest
Hi,

I have written a small script allowing users to download a file by simply click on the link....

The link looks like that:

Code:
echo "file: <a href=\"download.php?doc=$file\" class=maintext>$file</a><br>";

And here the code in my download.php file

Code:
<?
$file= $HTTP_GET_VARS['doc'];

 
  header("Content-Type: application/download\n"); 
  header("Content-Disposition: attachment; filename=\"$file\""); 
  $fn=fopen("$file" , "r"); 
  fpassthru($fn); 
  fclose($fn);

?>

You r gonna tell me where is the prob if everything woks???
The stuff is that once the file is download IE keep loading a page.. "this little annoying sand thingy"
How can I stop that...???

Thanks
francois

ps:sorry I knw it might not be revelant to php


How can
 
or you make the zip file of that file and give path
will give user download dialog...
or use the above said method
 
Back
Top