I want to increase sending (time) to upload files

Asked

Viewed 458 times

0

I have a script that works very well, which uploads multiple images and even inserts watermark.

The question is this: On the server, I can put 300s in the MAX_EXECUTION_TIME, and 30 files to upload. But considering that the images can be large, and the internet inside is not cool, I usually can’t send all the images, for bursting time.

What they recommend to me?

  • http://php.net/manual/en/features.file-upload.common-pitfalls.php

1 answer

-1

You can try increasing the running time via php.ini:

max_execution_time = 600

or in the php file itself

ini_set('max_execution_time','600');

Add more memory per run, this can help:

ini_set('memory_limit','512M');

If changing this configuration parameter is not possible, you can change the form that sends the files.

Instead of sending all images together in single SUBMIT you can through javascript upload files separately.

So the user will find that he is sending everything at once, more in fact he is sending file by file, which can reduce or eliminate the execution timeout of the PHP script

  • Rodrigo, thank you for your prompt reply. Analyzing the two situations, the right one, but the most complicated for me would be to redo the code in order to change the way the files were sent. I read on a site that it is complicated to increase the limit too much, at the risk of damaging the server performance.

  • Changing the way of sending is the right option to do, if possible send me the form and PHP code so I can help you. There are some different ways to do this I can clear up some of these ways with you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.