File upload limit problem...... havent found a solution yet!

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
Roger
Forum Newbie
Posts: 5
Joined: Wed Apr 14, 2004 11:15 am

File upload limit problem...... havent found a solution yet!

Post by Roger »

Hi,

It has to do with file size limits when uploading. if I try to upload a file above about 1.5 megs, the page returns a 404 error.

This has been covered before, but no answer I found works for me.
I'm running Apache on WinXP Prof. with php 4.3.4
Had the same problem with 4.x.

http://203.185.231.127/phpinfo.php

my php.ini has:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30
max_input_time = 60
memory_limit = 8M

and also:
post_max_size = 8M

and
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

file_uploads = On
upload_max_filesize = 8M

I don't have a php.conf file, so I cant set any LimitRequestBody value and LimitRequestBody doesnt show up anywhere else except in manual files.

when I try to upload a file larger then about 1 meg, i just get a "page cannot be found" page.

The pages have been tested on someone elses server, and work fine.

I dont have the site Im using set up as a virtual host, I just address it using the IP of my server.

you can test it here:
http://203.185.231.127/piccolo/index.php

thanks in advance!
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

it says on the page that upload filesize are limited to 1mb, but you are trying to upload something bigger!?

Mark
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

I think he's just saying that file uploads are limited to 1M as files over that size might not upload successfully due to this problem he has :o So you can upload files over 1M but they might not get there.

I've just tried a 3M file and it tells me "Fatal error: Maximum execution time of 30 seconds exceeded in e:\hosting\piccolo\do_upload.php on line 2" so the script probably just needs a :
set_time_limit(0); at the top.
Roger
Forum Newbie
Posts: 5
Joined: Wed Apr 14, 2004 11:15 am

Post by Roger »

Hi,

It already has that at the top....

I'll rar the files in case anyone is interested....

Thanks for looking guys... this has beaten the experts on Experts Exchange

[ http://www.experts-exchange.com/Web/Web ... l#10769938 ]

I have the hosted files on a different drive to Apache and php.. and the drive apache and php are on is fat32.. in case this makes a difference...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Hmm, if it already has set_time_limit(0); at the top then "Fatal error: Maximum execution time of 30 seconds exceeded" shouldn't be appearing. Can you confirm it's definetely in there ok?
Roger
Forum Newbie
Posts: 5
Joined: Wed Apr 14, 2004 11:15 am

Post by Roger »

yes, thats why I zipped the files and put them there for you to download.
It only needs it on the page that does the uploading right?

download the .rar file and take a look in do_upload.php...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Sorry, i don't see the .rar anywhere.
I've just woke up so maybe my eyes havn't focused fully yet ;)
Roger
Forum Newbie
Posts: 5
Joined: Wed Apr 14, 2004 11:15 am

Post by Roger »

my bad... try now
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Ah, do_upload is included from show_upload, so you'll need the set_time_limit(0); in show_upload.php not do_upload.php
Roger
Forum Newbie
Posts: 5
Joined: Wed Apr 14, 2004 11:15 am

Post by Roger »

Ok, tried that, still no good.

The code works on another server, so I guess its a server config error?
Post Reply