Fixed an image upload problem - might help others!
|
cmilkosk
Joined: 2003-07-06
Posts: 1 |
Posted: Sun, 2003-07-06 14:27
|
|
All - I don't know if others had a problem with uploading images > 512K in size, but I did some research in my web server logs and found: [Sun Jul 06 09:56:47 2003] [error] [client 192.168.0.1] Requested content-length of 1132291 is larger than the configured limit of 524288, referer: http://cmilkosk.pointclark.net/modules.php?get_albumName=album03&op=modload&name=gallery&fil e=index&include=add_photos.php So, I did a quick lookup in the Google newsgroups for this, and found a reply to someone with the same problem: Quote:
From: stchupack (frellu@hotmail.com) I just raised my LimitRequestBody, and all worked fine! Yay! :D I hope this helps others. Chris |
|
| Login or register to post comments |

Posts: 8187
I meant to add something similar to the FAQ. I'll do that in a bit. Thanks
Posts: 5
Hi,
I tried this but still have upload problem.....
setup: RH9, Apache 2.0.40, PHP 4.2.2, Gallerey 1.3.4
The first 2 pictures usually added and resize ok, then some thumbnail and resize pic got corrupted and getting all the errors....
Anyone encountered this?
Edmond
================
debug info from debug mode:
- Adding 03_canoe_camp_20.jpg
Executing:
/usr/bin/jpegtopnm /var/www/html/albums/canoe03/03_canoe_camp_20.jpg | /usr/bin/pnmscale -xysize 150 150 | /usr/bin/pnmtojpeg --quality=95 > /var/www/html/albums/canoe03/03_canoe_camp_20.thumb.jpg
Results:
none
Error messages:
jpegtopnm: WRITING PPM FILE
Status: 0 (expected 0)
Executing:
/usr/bin/jhead /tmp/gallery/photo.03_canoe_camp_20.jpg
Results:
File name : /tmp/gallery/photo.03_canoe_camp_20.jpg
File size : 1544331 bytes
File date : 2003:07:06 20:52:01
Camera make : Canon
Camera model : Canon PowerShot S230
Date/Time : 2003:05:17 16:33:41
Resolution : 2048 x 1536
Flash used : Yes
Focal length : 10.8mm (35mm equivalent: 74mm)
CCD width : 5.26mm
Exposure time: 0.0080 s (1/125)
Aperture : f/10.0
Metering Mode: matrix
Jpeg process : Baseline
Error messages:
Status: 0 (expected 0)IN UTIL ITEMCAPTUREDATE = 2003
- Resizing 03_canoe_camp_20.jpg
Executing:
/usr/bin/jpegtopnm /var/www/html/albums/canoe03/03_canoe_camp_20.jpg | /usr/bin/pnmscale -xysize 500 500 | /usr/bin/pnmtojpeg --quality=95 > /var/www/html/albums/canoe03/03_canoe_camp_20.sized.jpg
Results:
none
Error messages:
jpegtopnm: WRITING PPM FILE
jpegtopnm: Error writing single byte sample to file
pnmtojpeg: EOF / read error reading magic number
Status: 1 (expected 0)
Executing:
/usr/bin/jhead /var/www/html/albums/canoe03/03_canoe_camp_20.jpg
Results:
File name : /var/www/html/albums/canoe03/03_canoe_camp_20.jpg
File size : 1544331 bytes
File date : 2003:07:06 20:52:55
Camera make : Canon
Camera model : Canon PowerShot S230
Date/Time : 2003:05:17 16:33:41
Resolution : 2048 x 1536
Flash used : Yes
Focal length : 10.8mm (35mm equivalent: 74mm)
CCD width : 5.26mm
Exposure time: 0.0080 s (1/125)
Aperture : f/10.0
Metering Mode: matrix
Jpeg process : Baseline
Error messages:
Status: 0 (expected 0)
- Adding 03_canoe_camp_21.jpg
Executing:
/usr/bin/jpegtopnm /var/www/html/albums/canoe03/03_canoe_camp_21.jpg | /usr/bin/pnmscale -xysize 150 150 | /usr/bin/pnmtojpeg --quality=95 > /var/www/html/albums/canoe03/03_canoe_camp_21.thumb.jpg
Results:
none
Error messages:
jpegtopnm: WRITING PPM FILE
pnmtojpeg: EOF / read error reading a one-byte sample
jpegtopnm: Error writing single byte sample to file
Status: 1 (expected 0)
Error: Unable to make thumbnail (0)!
Posts: 5
I also realized that the same problem occur to resizing picture. It puzzle me that it looks like some kind of unflush cache problem to me... If I wait for a while and resize again, the piture turn out ok. And when it failed, I saw this error:
pnmtojpeg: EOF / read error reading a one-byte sample
jpegtopnm: Error writing single byte sample to file
Posts: 42
i looked at the php.conf file, but it only said this:
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
it doesn't have the LimitRequestBody line
i'm also having problems uploading anything > 2MB~
this is the error message i get:
Processing status...
- Adding CRW_4484.jpg
Warning: Unable to open '' for reading: No such file or directory in /var/www/html/gallery/platform/fs_unix.php on line 24
Warning: getimagesize: Unable to open '/var/www/html/albums/TypeSDragoon/acb.jpg' for reading. in /var/www/html/gallery/util.php on line 473
Error: Invalid image: acb.jpg!
Posts: 42
i found the answer to my problem here http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=7375
it worked
now i can finally upload images > 2MB
/etc/php.ini
Posts: 8187
Added to the new FAQ...
Posts: 5
I already had the upload_max_filesize > 2M, but my problem didn't go away...
Error message still say:
pnmtojpeg: EOF / read error reading a one-byte sample
jpegtopnm: Error writing single byte sample to file
Retry after a while works.... it's just weird.
ED$
Posts: 3
I'm having all the same problems as previous people in this thread, but none of the suggestions seem to help. I keep getting errors along the lines of "Request content-length of 508155 is larger than the configured limit of 75000" in my apache error log, and on the client side it's a "Requested Entity Too Large" error. I'm running Gallery 1.4.3pl1, PHP 4.2.3, and Apache 1.3.23. My server's php.ini has post_max_size = 8M and upload_max_filesize = 2M (which I'm not able to change, since I'm not an admin), and the Gallery .htaccess has set both of those values to 20971520. I tried setting the LimitRequestBody in .htaccess to 0, and then to some very large number. Nothing seems to affect this problem. I've managed to upload one very small photo, about 300x300 pixels, which is below the 75k limit. Anything else gets rejected.
Ideas?
Posts: 2322
You will have to contact your host to change the LimitRequestBody. It's probably a setting that you're not allowed to override, since that's the wall that you're hitting.
Posts: 3
That's what I thought, but I have read access to all the apache config files (except the ssl key file), and the only mentions of LimitRequestBody set it to 2147483647, and that is for a vhost file that doesn't affect my site. Anyway I have "AllowOverride all" on my site, so I should be able to change everything in a .htaccess file.
Thanks for the quick reply!
Posts: 1
Squid users: also make sure that your proxy allows making requests, which are big enough to carry your photos. You can accomplish that by entering the following line in squid.conf, i.e.:
request_body_max_size 4 MB
Restart squid after this and things should work.
Posts: 3
The Squid change fixed my problem! I was using Apache 1.3.13 and the 2.x references weren't helping. Thanks.
Posts: 1
I've had these files size problems as well. I've follow the suggestions on this form which I needed to do, but needed just one more thing to help me to upload a 50MB video file.
edit the .htaccess under the gallery directory and change the following
php_value post_max_size 80000000
php_value upload_max_filesize 80000000
php_value magic_quotes_gpc off
This helped me to the final result that I needed.
Posts: 22
For a single site / single server, the original post did the trick for me.
However, I can also see where a complex virtual host enviroment would warrant these changes.
Regardless, I was stumped until finding this.
Thanks So Much!
Posts: 1
thats all it takes
Posts: 2
"All - I don't know if others had a problem with uploading images > 512K in size, but I did some research in my web server logs and found: "
yeah and error logs are very helpfull :D
http://www.2pc.pl/
Posts: 1
I am using GoDaddy.com for hosting and found the following information which worked for me.
Locate php.ini in the root folder and add the following:
memory_limit = 50M
post_max_size = 8M
file_uploads = On
upload_max_filesize = 8M