Click to See Complete Forum and Search --> : File Download Problem


kinderjit
02-22-2008, 01:46 AM
hello alls,

I want to download a file with PHP and this is my code.......
<?
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=".$filename."");
header('Content-Length: '.filesize($fileName));
readfile("$fileName");
?>

This is giving me to download the file but the problem is this that it always close the main window.How can i handle this problem.now i am using this code by window.open with a pop-up option but i have idea about how can i hide the pop up if any have idea for this Pls tell me.

Thanks in advance......
Kinderjit singh........

FrostBite
02-22-2008, 07:59 AM
I've only seen this code one other time... and it was malicious. What exactly are you trying to do that the user can't initiate the download?

artemis
02-22-2008, 11:15 AM
Why exactly do you need a popup?