Page 1 of 1

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

Posted: Wed Apr 14, 2004 11:15 am
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!

Posted: Wed Apr 14, 2004 11:21 am
by JayBird
it says on the page that upload filesize are limited to 1mb, but you are trying to upload something bigger!?

Mark

Posted: Wed Apr 14, 2004 11:24 am
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.

Posted: Wed Apr 14, 2004 12:30 pm
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...

Posted: Wed Apr 14, 2004 3:04 pm
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?

Posted: Wed Apr 14, 2004 9:37 pm
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...

Posted: Thu Apr 15, 2004 2:56 am
by markl999
Sorry, i don't see the .rar anywhere.
I've just woke up so maybe my eyes havn't focused fully yet ;)

Posted: Thu Apr 15, 2004 2:57 am
by Roger
my bad... try now

Posted: Thu Apr 15, 2004 3:08 am
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

Posted: Thu Apr 15, 2004 5:03 am
by Roger
Ok, tried that, still no good.

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