class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I???m having issues with processing multiple images; I am using the basic example script, with one exception. I have added this to the MULTIPLE UPLOADS part:
The log ($handle->log )doesn???t show anything, the one thing I have learned is that the ???foreach??? loop dies on the second pass, when it gets to $handle->Process("./test/");
Is there some way to work around this problem?Reply
On a related note, is anyone else getting the annoyng timeout message when using Firefox? Is there a way, on the server side, to prevent Firefox from timing out? (The exact message is "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete")Reply
Tim, the message that you have in Firefox indicates that a client-side script is using too much resources, not a server-side script. If your upload scripts dies, or takes too long, you will have a simple Page not found message in Firefox.Reply
Well, all I know is that I can upload 1 MB file no problem. But with files that are much bigger, the upload process sometimes takes more than the standard Firefox timeout and causes the message, forcing the user to click Continue. I'm surprised nobody else is seeing this. I know I can change the Firefox settings on my machine, but that won't fix the problem for my users.
Maybe, out of curiosity, I'll check and see if some of the major photo sites cause the same problem during upload.Reply
Please let me know if you discover anything on that matter. It is possible that Firefox displays the message when uploading the image, which I think is not the right behaviour, since the browser is actually working while uploading the image; it is not hanging.
In any case, there's not a lot that we can do here. Using PHP upload forces us to this restrictions, not to mention the maximum upload size limit. If you want to upload really big images, and avoid problems that you described, maybe a Java solution would be more adapted. After all, PHP has its limits... ;)Reply
Seanie, I would have to do some more test, I am running out of time now. But I would say that the script runs out of memory, even thought you gave it 256MB.
I will be checking as soon as I can if the image objects are cleanly destroyed before each process.
Generally speaking, it is a bit heavy to do such big image manipulation in PHP/GD. Maybe using ImageMagick would be more adapted in your case.Reply
It works for small images, but for larger pictures (1.5mb each) it will only process one of the 3 photos.
I have changed my php.ini to have:
The log ($handle->log )doesn???t show anything, the one thing I have learned is that the ???foreach??? loop dies on the second pass, when it gets to $handle->Process("./test/");
Is there some way to work around this problem?
Maybe, out of curiosity, I'll check and see if some of the major photo sites cause the same problem during upload.
In any case, there's not a lot that we can do here. Using PHP upload forces us to this restrictions, not to mention the maximum upload size limit. If you want to upload really big images, and avoid problems that you described, maybe a Java solution would be more adapted. After all, PHP has its limits... ;)
I will be checking as soon as I can if the image objects are cleanly destroyed before each process.
Generally speaking, it is a bit heavy to do such big image manipulation in PHP/GD. Maybe using ImageMagick would be more adapted in your case.
max_execution_time = 90 ; This was my primary constraint.
max_input_time = 90
memory_limit = 10M
post_max_size = 10M
file_uploads = On
upload_max_filesize = 4M