I have built a function that uploads images onto a server. I am having random(sometimes occurs, sometimes not) timeouts upon submission of the form.
The form accepts a max of 4 images (4 file fields) + other textual data and has the following attributes:
method: "post"
action: "<?php echo("$PHP_SELF");?>"
enctype: "multipart/form-data"
What the function does:
When receiving the files, the function duplicates the original image into a smaller thumbnail and a medium viewable image, and finally deleting the original image after completion of the process.
My Problem:
Upon submission of data, the page starts to load and gives error "page cannot be displayed" after X(~25s) seconds. (note that this happens occasionally, 25-75% of the time, not everytime)
When browsing(via FTP) the destination directory, I've found that some images has rightly been upload while others not. I have tried with different numbers of images, sometimes it worked sometimes not. I tried uploading only 1 image at a time and still got timeout at random occasions, in the end my conclusion was that it did not depend on the number of images I uploaded.
All images are less than 100k.
I've already tried set_time_limit().
http://www.japanzintl.com/serv_info.php <- server information
http://www.japanzintl.com/submit_img.txt <- function used for uploading images
If anyone could point out where my error(if any) is please do so,
TIA,
-Dan
Note: I have the same stuff running flawlessly on another server http://www.delior.com/japanz/serv_info.php, but I have to make it work on this new server.