I have used a tutorial to create a PHP script to upload files to a server. It works beautifully for images and small files < 10mb but over that size it fails. I believe that this may be due to a server timeout. The question is, if I am correct in my assumption is there a way to tell the server to wait until the file has uploaded?
Of course there may be another issue I haven't thought of, according to the script I have the large uploads aren't producing an error and the "success" text is displayed!
Any helpful advice would be appreciated :)
Try this: http://php.net/manual/en/function.set-time-limit.php
You can set the timeout using set_time_limit($seconds)
If you set $seconds
to 0, the server won't time out - but use this very carefully!
In PHP there's a function called set_time_limit() which you can use to set how long it'll take before PHP terminates due to running to long. Be careful with it though because setting it to 0 can leave php processing waiting around forever and eat up your server resources.
You can also set this directive in php.ini or from apache .htaccess files.
There is also max_input_time in php.ini
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With