By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

why would a large not upload, when a small does, when it is still within the POST limit?

P: n/a
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.

I've set the POST limit in php.ini to 8 megs.

What reasons, other than the POST limit, would a large upload fail?

Jan 9 '06 #1
Share this Question
Share on Google+
16 Replies


P: n/a
On Sun, 08 Jan 2006 03:08:20 -0800, lawrence k wrote:
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.

I've set the POST limit in php.ini to 8 megs.

What reasons, other than the POST limit, would a large upload fail?

5 megs of binary data will be sent as a lot more than that of (base 64
encoded?) ascii data.

Try doubling your limit and see if it magically works.

Steve

Jan 9 '06 #2

P: n/a
lawrence k wrote:
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.

I've set the POST limit in php.ini to 8 megs.

What reasons, other than the POST limit, would a large upload fail?

Check also your script time-out limit. Your long upload might be taking
too long?
Jan 10 '06 #3

P: n/a
jo*********@sbcglobal.net says...
lawrence k wrote:

I've set the POST limit in php.ini to 8 megs.

What reasons, other than the POST limit, would a large upload fail?


Check also your script time-out limit. Your long upload might be taking
too long?


If you're using PHP on Apache check that the httpd.conf settings aren't
lower than your PHP settings.

Geoff M
Jan 10 '06 #4

P: n/a
On Mon, 09 Jan 2006 23:13:23 +1300, Steve <Th*****@Aint.Valid> wrote:
On Sun, 08 Jan 2006 03:08:20 -0800, lawrence k wrote:
What reasons, other than the POST limit, would a large upload fail?


5 megs of binary data will be sent as a lot more than that of (base 64
encoded?) ascii data.

Try doubling your limit and see if it magically works.


File uploads are not base64 encoded, they are sent pretty much raw using
multipart/form-data.

http://www.w3.org/TR/html4/interact/...ml#h-17.13.4.2

A 5MB file will take 5MB plus a few bytes overhead for headers.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 20 '06 #5

P: n/a
On 8 Jan 2006 03:08:20 -0800, "lawrence k" <lk******@geocities.com> wrote:
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.
The single most annoying phrase when describing problems, if not followed by
details. In what way did it not work?

What error did you get? You checked for errors and have error reporting turned
on, right?
I've set the POST limit in php.ini to 8 megs.

What reasons, other than the POST limit, would a large upload fail?


Various. Almost all of which produce errors, either in the form of PHP errors,
Apache errors or the field in $_FILES.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 20 '06 #6

P: n/a

Andy Hassall wrote:
On 8 Jan 2006 03:08:20 -0800, "lawrence k" <lk******@geocities.com> wrote:
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.
The single most annoying phrase when describing problems, if not followed by
details. In what way did it not work?


Sorry, here is what is happening. If, in FireFox 1.5, I login to the
control panel, and I try to upload a small jpeg image, 234k, it uploads
without a problem. If, on the other hand, I try to upload an 8 meg PDS
file, I instantly (no attempt at upload) get this FireFox message:

The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try
again in a few
moments.
* If you are unable to load any pages, check your computer's
network
connection.
* If your computer or network is protected by a firewall or
proxy, make sure
that Firefox is permitted to access the Web.

In Internet Explorer, uploading the small file is no trouble, but
uploading the big one gives me this:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to adjust
your browser settings.


Following the advice of others on this thread we (or rather, Matt
Clark, our Linux guy) have edited the php.ini file to allow 50 meg
uploads. We also looked through the config file for Apache and saw
nothing there that might have limited uploads. But the problem
persists.
What error did you get? You checked for errors and have error reporting turned
on, right?


I'm not sure, but I don't think I have access to the errors on the
server. I'm sure Matt does though, so I'll ask him to send me these
logs.

Jan 24 '06 #7

P: n/a

Andy Hassall wrote:
On 8 Jan 2006 03:08:20 -0800, "lawrence k" <lk******@geocities.com> wrote:
I've a file upload script on my site. I just now used it to upload a
small text document (10k). Everything worked fine.

Then I tried to upload a 5.3 meg Quicktime video.

Didn't work.


The single most annoying phrase when describing problems, if not followed by
details. In what way did it not work?

What error did you get? You checked for errors and have error reporting turned
on, right?


Our Linux guy, Matt Clark, checked for errors. He said there were no
errors in the PHP log.

Jan 25 '06 #8

P: n/a
if you're uploading to a database, are you using MEDIUMBLOB or LONGBLOB for
a data type?

"lawrence k" <lk******@geocities.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...

Andy Hassall wrote:
On 8 Jan 2006 03:08:20 -0800, "lawrence k" <lk******@geocities.com>
wrote:
>I've a file upload script on my site. I just now used it to upload a
>small text document (10k). Everything worked fine.
>
>Then I tried to upload a 5.3 meg Quicktime video.
>
>Didn't work.


The single most annoying phrase when describing problems, if not
followed by
details. In what way did it not work?


Sorry, here is what is happening. If, in FireFox 1.5, I login to the
control panel, and I try to upload a small jpeg image, 234k, it uploads
without a problem. If, on the other hand, I try to upload an 8 meg PDS
file, I instantly (no attempt at upload) get this FireFox message:

The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try
again in a few
moments.
* If you are unable to load any pages, check your computer's
network
connection.
* If your computer or network is protected by a firewall or
proxy, make sure
that Firefox is permitted to access the Web.

In Internet Explorer, uploading the small file is no trouble, but
uploading the big one gives me this:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to adjust
your browser settings.


Following the advice of others on this thread we (or rather, Matt
Clark, our Linux guy) have edited the php.ini file to allow 50 meg
uploads. We also looked through the config file for Apache and saw
nothing there that might have limited uploads. But the problem
persists.
What error did you get? You checked for errors and have error reporting
turned
on, right?


I'm not sure, but I don't think I have access to the errors on the
server. I'm sure Matt does though, so I'll ask him to send me these
logs.

Jan 25 '06 #9

P: n/a
On 24 Jan 2006 17:13:53 -0800, "lawrence k" <lk******@geocities.com> wrote:
Andy Hassall wrote:
What error did you get? You checked for errors and have error reporting turned
on, right?


Our Linux guy, Matt Clark, checked for errors. He said there were no
errors in the PHP log.


That's one log down, then. What about the others?

Hint:
What reasons, other than the POST limit, would a large upload fail?


Various. Almost all of which produce errors, either in the form of PHP errors,
Apache errors or the field in $_FILES.

^^^^^^^^^^^^^

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 25 '06 #10

P: n/a

Jim Michaels wrote:
if you're uploading to a database, are you using MEDIUMBLOB or LONGBLOB for
a data type?
No, we are not uploading to a database. We are just uploading files
from our personal computers to the web server, where they are stored as
flat files.

"lawrence k" <lk******@geocities.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...

Andy Hassall wrote:
On 8 Jan 2006 03:08:20 -0800, "lawrence k" <lk******@geocities.com>
wrote:

>I've a file upload script on my site. I just now used it to upload a
>small text document (10k). Everything worked fine.
>
>Then I tried to upload a 5.3 meg Quicktime video.
>
>Didn't work.

The single most annoying phrase when describing problems, if not
followed by
details. In what way did it not work?


Sorry, here is what is happening. If, in FireFox 1.5, I login to the
control panel, and I try to upload a small jpeg image, 234k, it uploads
without a problem. If, on the other hand, I try to upload an 8 meg PDS
file, I instantly (no attempt at upload) get this FireFox message:

The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try
again in a few
moments.
* If you are unable to load any pages, check your computer's
network
connection.
* If your computer or network is protected by a firewall or
proxy, make sure
that Firefox is permitted to access the Web.

In Internet Explorer, uploading the small file is no trouble, but
uploading the big one gives me this:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site
might be experiencing technical difficulties, or you may need to adjust
your browser settings.


Following the advice of others on this thread we (or rather, Matt
Clark, our Linux guy) have edited the php.ini file to allow 50 meg
uploads. We also looked through the config file for Apache and saw
nothing there that might have limited uploads. But the problem
persists.
What error did you get? You checked for errors and have error reporting
turned
on, right?


I'm not sure, but I don't think I have access to the errors on the
server. I'm sure Matt does though, so I'll ask him to send me these
logs.


Jan 26 '06 #11

P: n/a

Andy Hassall wrote:
Our Linux guy, Matt Clark, checked for errors. He said there were no
errors in the PHP log.


That's one log down, then. What about the others?

Hint:
What reasons, other than the POST limit, would a large upload fail?

Various. Almost all of which produce errors, either in the form of PHP errors,
Apache errors or the field in $_FILES.


I don't suppose you'd know what these error files are typically called,
do you? I asked our server guy to send me the PHP error logs and he
said that PHP had only recently invented server logs, and that I
probably wanted the syslogs instead. Then he send a whole bunch of
files, with names like ssl_error_log.1 and suexec_log and error_log.2.
These have line after line that look like this:

[Mon Jan 09 11:18:38 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.0-pl1
[Mon Jan 09 11:18:39 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.3-pl1
[Mon Jan 09 11:18:39 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.3
[Mon Jan 09 11:18:39 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.3-rc1
[Mon Jan 09 11:18:39 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.2-rc1
[Mon Jan 09 11:21:08 2006] [notice] Graceful restart requested, doing
restart
Warning: DocumentRoot [/home/httpd/vhosts/grandingardens.com/httpdocs]
does not exist
[Mon Jan 09 11:21:14 2006] [notice] Digest: generating secret for
digest authentication ...
[Mon Jan 09 11:21:14 2006] [notice] Digest: done
[Mon Jan 09 11:21:15 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:21:15 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:21:15 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:21:16 2006] [notice] Apache/2.0.46 (Red Hat) configured
-- resuming normal operations
[Mon Jan 09 11:36:07 2006] [notice] Graceful restart requested, doing
restart
[Mon Jan 09 11:36:07 2006] [notice] Digest: generating secret for
digest authentication ...
[Mon Jan 09 11:36:07 2006] [notice] Digest: done
[Mon Jan 09 11:36:08 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:36:08 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:36:08 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Mon Jan 09 11:36:08 2006] [notice] Apache/2.0.46 (Red Hat) configured
-- resuming normal operations
[Mon Jan 09 11:38:00 2006] [error] [client 66.249.65.106] File does not
exist: /home/httpd/vhosts/default/htdocs/robots.txt
[Mon Jan 09 11:42:51 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/awstats
[Mon Jan 09 11:42:53 2006] [error] [client 202.90.149.5] script not
found or unable to stat: /home/httpd/vhosts/default/cgi-bin/awstats.pl
[Mon Jan 09 11:42:54 2006] [error] [client 202.90.149.5] script not
found or unable to stat: /home/httpd/vhosts/default/cgi-bin/awstats
[Mon Jan 09 11:42:56 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/xmlrpc.php
[Mon Jan 09 11:42:57 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/blog
[Mon Jan 09 11:42:59 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/blog
[Mon Jan 09 11:43:00 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/blogs
[Mon Jan 09 11:43:01 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/drupal
[Mon Jan 09 11:43:02 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/phpgroupware
[Mon Jan 09 11:43:03 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/wordpress
[Mon Jan 09 11:43:05 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/xmlrpc.php
[Mon Jan 09 11:43:06 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/xmlrpc
[Mon Jan 09 11:43:07 2006] [error] [client 202.90.149.5] File does not
exist: /home/httpd/vhosts/default/htdocs/xmlsrv

I don't see anything in here that might tell me why large files are
failing to upload. I have been able to upload a file of less than 1
meg, but anything larger than that seems to fail. In FireFox I get a
"Connection reset by the server" message.

Feb 16 '06 #12

P: n/a
On Wed, 15 Feb 2006 19:46:10 -0800, lawrence k wrote:

Andy Hassall wrote:
>Our Linux guy, Matt Clark, checked for errors. He said there were no
>errors in the PHP log.


That's one log down, then. What about the others?

Hint:
>>>What reasons, other than the POST limit, would a large upload fail?
>>
>> Various. Almost all of which produce errors, either in the form of
>> PHP errors,
>>Apache errors or the field in $_FILES.


I don't suppose you'd know what these error files are typically called, do
you?


PHP can be told not to log errors, or if not that, to log them in various
ways (syslog, or Apache's log files, or to a specif one of your choosing).

So first look at php.ini and make sure that "log_errors = On" in there.
On my setup that is all that is needed for PHP errors to be written to
Apache's error_log file. The files called error_log.2 and so on are older
versions made when the logs get "rotated".

The logs have times in them so obviously you need to find the file that
has errors timed at the time you have provoked the error.

Elsewhere in php.ini is a setting to control where errors get logged
(error_log = ...). If you can set this to the name of a file on the
server that you can read, then you won't need to be sent the logs.
Setting it to "syslog" will make PHP error get logged to the same place as
almost everything else on the server and will just make yours very hard to
find, so make sure it is either commented out (errors go to Apache logs)
or it is set to file specifically for PHP errors (the more useful setting).

--
Ben.

Feb 16 '06 #13

P: n/a
On 15 Feb 2006 19:46:10 -0800, "lawrence k" <lk******@geocities.com> wrote:
Andy Hassall wrote:
>Our Linux guy, Matt Clark, checked for errors. He said there were no
>errors in the PHP log.
That's one log down, then. What about the others?

Hint:
>>>What reasons, other than the POST limit, would a large upload fail?
>>
>> Various. Almost all of which produce errors, either in the form of PHP errors,
>>Apache errors or the field in $_FILES.


I don't suppose you'd know what these error files are typically called,
do you? I asked our server guy to send me the PHP error logs and he
said that PHP had only recently invented server logs, and that I
probably wanted the syslogs instead. Then he send a whole bunch of
files, with names like ssl_error_log.1 and suexec_log and error_log.2.
These have line after line that look like this:

[Mon Jan 09 11:18:38 2006] [error] [client 212.126.96.21] File does not
exist: /home/httpd/vhosts/default/htdocs/phpMyAdmin-2.6.0-pl1


[snip]
I don't see anything in here that might tell me why large files are
failing to upload.
So, do the timestamps in the logfile correspond to times you tried to upload
files?

error_log is the main Apache error log file (by default anyway) and is the
most likely one to contain the answer.

error.log.2 would be an old log file, as further indicated by the timestamps
on the errors you posted being several weeks ago.

Upload a file. Check the end of error_log for new messages.
I have been able to upload a file of less than 1
meg, but anything larger than that seems to fail. In FireFox I get a
"Connection reset by the server" message.


What I'm trying to steer you towards is the Apache error log (which you seem
to have found now, or at least are close), because I bet you have an error in
there similar to:

[Wed Jan 25 23:14:11 2006] [error] [client 192.168.1.14] Requested
content-length of 3191154 is larger than the configured limit of 3000000,
referer: http://server.localhost/~andyh/file_upload.php

This is the most likely cause of the problem I can think of that matches the
symptoms you describe.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Feb 16 '06 #14

P: n/a

Andy Hassall wrote:
What I'm trying to steer you towards is the Apache error log (which you seem
to have found now, or at least are close), because I bet you have an error in
there similar to:

[Wed Jan 25 23:14:11 2006] [error] [client 192.168.1.14] Requested
content-length of 3191154 is larger than the configured limit of 3000000,
referer: http://server.localhost/~andyh/file_upload.php

This is the most likely cause of the problem I can think of that matches the
symptoms you describe.


That error would make sense, and that is what I first assumed. Still,
we've edited the php.ini file to allow 100 meg uploads, so an error of
that kind is impossible, yes? For an 8 meg PDF file, say?

You can see the output of the phpinfo() command here:

http://www.publicdomainsoftware.org/info.php

Note that it says:

post_max_size 100M

Are there any other settings that would limit the size of uploads?

Thanks for all your help.

Feb 17 '06 #15

P: n/a
On 16 Feb 2006 19:49:48 -0800, "lawrence k" <lk******@geocities.com> wrote:
Andy Hassall wrote:
What I'm trying to steer you towards is the Apache error log (which you seem
to have found now, or at least are close), because I bet you have an error in
there similar to:

[Wed Jan 25 23:14:11 2006] [error] [client 192.168.1.14] Requested
content-length of 3191154 is larger than the configured limit of 3000000,
referer: http://server.localhost/~andyh/file_upload.php

This is the most likely cause of the problem I can think of that matches the
symptoms you describe.


That error would make sense, and that is what I first assumed. Still,
we've edited the php.ini file to allow 100 meg uploads, so an error of
that kind is impossible, yes?


No. The error above is an Apache error in response to an Apache configuration
setting. Search Google to find out what it is, after you find it in your Apache
error log.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Feb 17 '06 #16

P: n/a

Andy Hassall wrote:
On 16 Feb 2006 19:49:48 -0800, "lawrence k" <lk******@geocities.com> wrote:
Andy Hassall wrote:
What I'm trying to steer you towards is the Apache error log (which you seem
to have found now, or at least are close), because I bet you have an error in
there similar to:

[Wed Jan 25 23:14:11 2006] [error] [client 192.168.1.14] Requested
content-length of 3191154 is larger than the configured limit of 3000000,
referer: http://server.localhost/~andyh/file_upload.php

This is the most likely cause of the problem I can think of that matches the
symptoms you describe.


That error would make sense, and that is what I first assumed. Still,
we've edited the php.ini file to allow 100 meg uploads, so an error of
that kind is impossible, yes?


My bad. The problem now seems to have something to do with the T1 that
runs to our office, or the firewall we put in or something. We called
Rackspace, from whom we lease our web server, and asked them about this
problem, and the guy on the phone said he could upload files from where
he was. Then he called some of his co-workers who were not working and
asked them to log in from their homes (they are not kidding when
Rackspace talks about Fanatical Support). Other folks did not have a
problem. I then logged in using my laptop on a dial up line, and I was
able to upload a 3 meg problem. So the problem is maybe with our
firewall or T1. In retrospect, it occurs to us the problem started
about when the T1 got put in. We were confused on this issue because
early on we asked a friend up in New York to try it and they also had
trouble. Perhaps they also ran into firewall trouble up where they
were.

Thanks for all the help. We should have checked from more sources early
on. My bad.

Feb 18 '06 #17

This discussion thread is closed

Replies have been disabled for this discussion.