File Upload Connection Interrupted

images php coding issues or problems here.

Moderators: macek, egami, gesf

Gretchen
New php-forum User
New php-forum User
Posts: 5
Joined: Mon Sep 05, 2011 6:51 pm

File Upload Connection Interrupted

Postby Gretchen » Mon Sep 19, 2011 7:09 am

Hey there. I'm having a very mysterious file upload problem. I've got a form where users can select a photo to upload, then they click the submit button. It works just fine with a 25 kb file, but a 100 kb file results in getting an error from the browser saying that the connection was interrupted.

At first, I could only get the upload to work for a 10 kb file and the 25 kb file would result in the same error, but by changing max_execution_time and max_input_time from 30 to 90 I was able to get the 25 kb file to upload successfully (even though it's still taking under 30 seconds). But increasing max_execution_time and max_input_time more than that hasn't solved the problem for files over 25 kb.

Does anyone have any ideas for where I should look? I think this must be a configuration issue, not a code issue, since it's working just fine with smaller files, but now I can't figure out what else could be wrong. If anyone has any ideas, please send them my way. I will be very grateful.

Gretchen

Gretchen
New php-forum User
New php-forum User
Posts: 5
Joined: Mon Sep 05, 2011 6:51 pm

Re: File Upload Connection Interrupted

Postby Gretchen » Mon Sep 19, 2011 9:36 am

Also, if it helps, in the form, I've set MAX_FILE_SIZE to 1000000. And in the php5.ini file, post_max_size is 8M.

I'm using php5, apache2 and ubuntu.

Gretchen

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: File Upload Connection Interrupted

Postby egami » Mon Sep 19, 2011 11:17 am

aside from max_post_size, there is an upload_max_filesize.
I recommend changing this to something other than default. I usually use 50mb.

Gretchen
New php-forum User
New php-forum User
Posts: 5
Joined: Mon Sep 05, 2011 6:51 pm

Re: File Upload Connection Interrupted

Postby Gretchen » Mon Sep 19, 2011 3:54 pm

That did it!

Even though upload_max_filesize was set to 8M before, changing it to 50M fixed my problem. Thank you!

Gretchen


Return to “PHP coding => Images”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest