File upload problems in PHP 4.3.2

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

File upload problems in PHP 4.3.2

Post by clem_c_rock »

Hello,

I have an upload script that worked fine until I moved it to a server w/ php 4.3.2. Now when I browse in a file and hit submit, I get a "document contains no data" error.

This happens when I reach a certain file size limit.

I went to php.ini and set post_max_size = 20M
and set upload_max_filesize = 20M

I also did set this in the actual form code:
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">

None of this seemed to effect anything.

Also, I was getting the "document contains no data" error when the files were only 1.9 mb.

Any ideas?

Thanks,
clem C
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

Problem Solved!!!

Post by clem_c_rock »

Hello,

I just wanted to let everyone know how I solved this issue.

The problem was actually apache. In the php.conf file (located, on my machine at: /etc/httpd/conf.d/php.conf), I changed this line: LimitRequestBody 524288
to: LimitRequestBody 10240000

<Files *.php*>
SetOutputFilter PHP
SetInputFilter PHP
# LimitRequestBody 524288
LimitRequestBody 10240000
</Files>

After I did that and rebooted the server it worked like a charm!

Thanks for y'all's hellp.

Clem C
Post Reply