PHP "max_input_time" and "handling file uploads"

fomalhaut

Member
Messages
107
Reaction score
0
Points
16
Hello all.

That's a problem I have with another website that uses php (not in x10), but I've no doubts some of you know the answer:

At my home, I've a poor very lent web connection, and at work, I've a very rapid web connection.

I have to upload some files of about 150 Ko (the distant server doesn't accept file size more than 200 Ko). When I upload from my workplace, there is no problem. But when I upload from my home, there is often the message which indicates a too big file (that is not the reality). If then I go backwards and upload again the same file several times in a row (it can be 2, 3... 75 times !), the upload finally succeeds.

I've seen in the php documentation, there is the max_input_time parameters, which is 60s by default, that could be the culprit:

"The max_input_time sets the maximum time, in seconds, the script is allowed to receive input; this includes file uploads. For large or multiple files, or users on slower connections, the default of 60 seconds may be exceeded."
And I suspect the script to give the same message (of too big file) whatever the error number.

I also see in the php documentation for "handling file uploads" that the error code is "3" (i.e. "UPLOAD_ERR_PARTIAL") when "the uploaded file was only partially uploaded". Can it be the way in case of max_input_time overflow ?

Thank you very much in advance for your answers.
 

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
I can't confirm that this 'big file size error' is due to max_input_time or not .Without looking at the source code of script, it is hard to tell.But If you can modify the script which handles the file upload put this php code on top of it.
PHP:
<?php
$input_time=240;//your desired value
ini_set('max_input_time',$input_time);
echo ini_get('max_input_time');//This will print the value of max_input_time so you will be able to know it is modified or not.
?>

Also check if this problem exists with other browsers or not.
 

fomalhaut

Member
Messages
107
Reaction score
0
Points
16
Sure, we can't know the real cause for this error without the code. I can't personaly modify, nor see it, but I will ask the guy on the server to add the code you give in his script. So we will know, and probably arranged the problem.

Thank you very much.

I've forgot: I've tried with other browsers: idem !
 
Last edited:
Top