Zubrag.com
May 20, 2012, 10:49:22 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Downloader stalls consistenly on files over 1 MB (IIS6/Win2k3)  (Read 2781 times)
butter
Newbie
*
Posts: 2


« on: May 18, 2007, 11:12:56 am »

Having a strange problem with the downloader.  The script is up on a server running Win2k3/IIS6.  Works PERFECTLY for smaller files.  But whenever anyone tries to download anything over 1 MB, the download stalls.  It looks like it's still churning, but the process bar stops totally, and the file is never completely downloaded.  Problem is universal across all browsers/platforms.  So, my first thought, "Obviously, it's a server setting."  I tried upping the max timeout props in php.ini and upping the CGI timout property in IIS.  No luck.  Same thing still happens.

Any ideas what to try next.  I really love the script, and except for this one problem does everything I need it to exactly the way I want it to.

Thanks.

Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #1 on: May 18, 2007, 01:13:23 pm »

Maybe it has something to do with max memory allowed for the script?

Try playing with these settings in php.ini:
memory_limit
max_execution_time

I also have one idea... currently script tries to load whole file being downloaded at once. Maybe script have to load parts sequentially.

for this will have to change

@readfile($file_path);

to

$file = @fopen($file_path,"rb");
if ($file) {
  while(!feof($file)) {
    print(fread($file, 1024*8));
    flush();
    if (connection_status()!=0) {
      @fclose($file);
      die();
    }
  }
  @fclose($file);
}
Logged
butter
Newbie
*
Posts: 2


« Reply #2 on: May 18, 2007, 01:28:31 pm »

Z,

When I got into the ini file and looked at the settings, I remembered that my max execution time and memory limit were already upped a while back for a PHP upload script.  BUT...

The second fix you suggested seems to be working quite well.  I still haven't tested it for fairly large files, but it seems to hold up consistently for 10MB and below, which is going to be 90% of the use it sees.

Thanks a million!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC