Server quits when upload exceeds 60 seconds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Moose Man
    New Member
    • Aug 2006
    • 1

    #1

    Server quits when upload exceeds 60 seconds

    My file upload page stops processing after 60 seconds, then Browser displays: "CANNOT FIND SERVER" .

    The Hosting company tech support people say: “The way around this is to return some data periodically. Maybe every 10-15 seconds return some data back so that the server knows that the script is still alive and working. That should get around the 60 second timeout.”

    I have searched the Web for example of this, with no luck. Not even sure exactly what to look for. Can anyone provide some guidance on how to add what tech support suggested?

    Here’s what I have so far (which works fine on small files):

    Here's the HTML Upload form ############### ############

    Code:
    <form enctype="multipart/form-data" action="../admin/file.catcher.admin.php" method="POST">
    
     	<input type="hidden" name="MAX_FILE_SIZE" value="400000" />			
    	<input type="hidden"  name="max_input_time" value="10000" />
      
    	<p>Upload a File</p>
    
    	<p>File Name: &nbsp;<input name="userfile" type="file" /> &nbsp;
    	<input type="submit" value=" Upload File Now " /></td>	
    
    </form>
    	
    Here's the PHP form handler ############################
    
    <?
    
    $uploaddir = '/ - absolute path here - /';
    $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
    
    echo '<pre>';
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
       echo "File successfully uploaded.\n";
    }
     
    else {
       echo "Upload Error!\n\n";
    
    echo "
      
    ";
    print_r($_FILES);
    
    print "</pre>";
    
    }
    
    }
    
    ?>
    Last edited by Markus; Apr 18 '09, 06:55 PM. Reason: Very old post. Forgot to add code tags when I answered it.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Check out set_time_limit( ).

    Comment

    Working...