Try to catch a page timeout

Hi,

I’m writing a form to upload files (60Mb).
To solve php timing out en complain about the filesize I use
ini_set(‘php_value upload_max_filesize’,‘60M’);
ini_set(‘php_value post_max_size’,‘60M’);
ini_set(‘php_value max_execution_time’,‘360’);
ini_set(‘php_value max_input_time’,‘360’);
If an upload takes longer than 360seconds, php will timeout.

I was wondering if I can prevent php from timing out by
intercepting the uploadprocess after 350 seconds and then echo “Your upload takes to long. Send a smaller file”.

any help and ideas are much welcomed.

I’m pretty sure that PHP time limit doesn’t come into play until the file has finished uploading.

upload -> webserver -> upload complete -> php

In any case, you can’t intercept the request in order to send the error message, except for maybe if you use APC (http://www.haughin.com/2007/10/23/php-upload-progress-with-php-52-apc/). You can’t stop the upload, but you can show the message.