Forum Moderators: coopster

Message Too Old, No Replies

PHP upload timeout?

Is there an upload timout for PHP

         

sveijk

1:08 am on Nov 18, 2003 (gmt 0)

10+ Year Member



I recently implemented some PHP script on my site to allow users to upload pictures into autogenerated galleries.

I tested the script over my LAN, and sucessfully managed to upload multiple pictures through this system to the site... no problems. The pictures got all their thumbnails made and had hyperlinks produced etc.

Since my server is located at home behind a b-band router, i thought it would be prudent to test whether or not the system worked from the internet side of things. So remote desktopped to another pc and did more uploading and again no problems.

However when my users started to use the script some of them found their images were scrambled, the upload appeared to work, but then when you looked at the image half of it was right, and the rest was scrambled like as if it hadn't uploaded completely.

May i stress here this is not a maximum filesize problem, as from other locations the same images would upload perfectly, and the cap is set ridiculously high anyway...

Does php have a timeout i can't find? or is something else happening? and if so why is it so quick...

Any suggestions would be appreciated

Sveijk'y #;)

coopster

1:37 am on Nov 18, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to Webmasterworld, sveijk!

You say the images seem to upload completely. Can you FTP to the server, download one of the images they are having trouble viewing and view it locally on your pc with a browser or other image-viewing software? If so, then you know the upload portion of the script is working as designed, but then you have a problem with the image manipulation and viewing portion of your script. Let's start there.

sveijk

8:06 am on Nov 18, 2003 (gmt 0)

10+ Year Member



No, both the temporary image and final copied images are corrupted on the server. It is the standard bit of copied and pasted file debug info which tells me that the server thinks it has the whole image.

Sorry should have mentioned i'm using forms upload just to clarify.

sveijk'y

barn_de

2:05 pm on Nov 18, 2003 (gmt 0)

10+ Year Member



Hi sveijk,

yes, there is a timeout in php. it is set normally to 30 sec. you can change it in the php.ini or in the php file directly. just type at the beginning of the php script

set_time_limit(0);

this will turn off the time limit.

i hope this fixes your problem

barn

sveijk

7:53 pm on Nov 18, 2003 (gmt 0)

10+ Year Member



Cheers dude, but not the time out i was wanting i'm afraid

The scripting timeout is set to two minutes anyway, but i was wondering if there was an uploading time out.... Might be an apache setting rather than php...

But these uploads seem to be only taking two or three seconds no where near thirty.

I have noticed the only people experiencing problems so far are winxp users though. So wondering if there is some difficulty there. I've decided to add a delay between uploading the file and copying it out, in case it is reporting that it has uploaded early.

Unfortunately due to the nature of the problem i can only wait for my users to report it, cause no matter how hard i try i can't reproduce it myself...

so here's hoping

Sveijk'y #;)

coopster

12:50 am on Nov 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sveijk, these things can be difficult to troubleshoot. Hang in there.

>>but i was wondering if there was an uploading time out.... Might be an apache setting rather than php...

Very well could be. Here is a post that might offer some direction. Post #8 is specifically has some information you may want to check regarding the Apache directive.

[webmasterworld.com...]

sveijk

2:36 am on Nov 19, 2003 (gmt 0)

10+ Year Member



Cheers for all the help dudes.

So far simply telling the script to wait ten seconds b4 moving the file seems to be working... So it may well be an error the machine is making to itself reporting as and when an upload has finished. who knows?

Probably would be prudent to upgrade the apache server.. and php stuff, but if this works then i can't really be that bothered.

Here's crossing my fingers, about twenty user images have been uploaded thus far without error.

Sveijky #;

sveijk

4:22 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



Epilogue:

It turns out all of the users whom were having these uploading difficulties were behind transparent proxy servers run by their ISP (specifically ntl home in this case)

Being the only common reason for this problem, I can only conclude that the proxy server is not handling uploads correctly.

Others may wish to be aware of simmilar problems in the future.

Sveijk'y #;)