Force Download not completing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
djwesters
Forum Newbie
Posts: 2
Joined: Wed Nov 24, 2004 5:35 am

Force Download not completing

Post by djwesters »

I've managed to get the force download to work using the code below, but when i try and download a large file, it finishes before it has completed downloading and always just before taking 5 mins. I'm using IIS 6.0 and PHP 4.3.9, (but i have also tried it with IIS 5 and it did the same thing). Any ideas??

Code: Select all

<?php 
//Set this to the base of where files 
//can be downloaded from for security measures. 
$basedir = "C:/Websites/";
if(!$_GET&#1111;'file']) &#123; 
print "Sorry that file does not exist"; 
exit; 
&#125; 
elseif(!file_exists($basedir.$_GET&#1111;'file'])) &#123; 
print "Sorry that file does not exist"; 
exit; 
&#125; 
else &#123; 
header("Content-Type: octet/stream"); 
header("Content-Disposition: attachment; filename="".$_GET&#1111;'file']."""); 
$fp = fopen($basedir.$_GET&#1111;'file'], "r"); 
$data = fread($fp, filesize($basedir.$_GET&#1111;'file'])); 
fclose($fp); 
print $data; 
&#125; 
?>&#1111;code]
[quote][/quote]
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

what is the max_execution_time setting?
djwesters
Forum Newbie
Posts: 2
Joined: Wed Nov 24, 2004 5:35 am

Post by djwesters »

its set to 30 seconds, I have tried modifing this but it didnt make any difference. If it was that wouldn't it time out after 30 seconds rather than 5 mins (or 300 seconds)?
Post Reply