File Upload problem

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
hanspaul
Forum Newbie
Posts: 5
Joined: Wed Aug 25, 2004 11:32 am
Location: Berkeley, CA
Contact:

File Upload problem

Post by hanspaul »

I am implementing a file upload page. Somehow whenever the file size exists some size (500 KB), the following error will be produced:

In mozilla -- the page contains no data
In IE ------- the page cannot be displayed

I think I already configured php_conf and httpd.conf currectly..

my php_info page is displayed as followed
http://199.133.139.222/~hanspaul/phpinfo.htm

It is for a sun server,
the same setup seems to work well in our linux web server.

Why?!

Hans
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

on your upload page, do you have a hidden field of MAX_FILE_SIZE ?
hanspaul
Forum Newbie
Posts: 5
Joined: Wed Aug 25, 2004 11:32 am
Location: Berkeley, CA
Contact:

Post by hanspaul »

Yes, I set it to some big number..

<FORM ENCTYPE=multipart/form-data METHOD="post" action="upload.php">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo 1024*1024*200; ?>" >

so it should support up to 200MB..but not doest even work for 1MB.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

And it's not taking more than 30 seconds to upload? The default script timeout is 30 seconds so maybe try a set_time_limit(0); at the top of the script.
hanspaul
Forum Newbie
Posts: 5
Joined: Wed Aug 25, 2004 11:32 am
Location: Berkeley, CA
Contact:

Post by hanspaul »

no.. it takes less than 1 second. Because it's an intranet. I put that page up anyway, still doesn't work.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your phpinfo says you have a 8M max file size and post limit btw..
hanspaul
Forum Newbie
Posts: 5
Joined: Wed Aug 25, 2004 11:32 am
Location: Berkeley, CA
Contact:

Post by hanspaul »

yes I know that..and actually I just want it to make it work with <= 2MB files.
hanspaul
Forum Newbie
Posts: 5
Joined: Wed Aug 25, 2004 11:32 am
Location: Berkeley, CA
Contact:

Post by hanspaul »

so no more helps from you guys ? :(
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

be patient.
jroo
Forum Newbie
Posts: 3
Joined: Wed Oct 13, 2004 11:33 pm
Location: Canada

Same problem

Post by jroo »

Hello, i am having the same problem, I can figure this out it's been driving me nuts for a couple of weeks.
Here is my phpinfo

http://www.phototomato.com/phpinfo.php
I have made all these following changes but it did not fix the problem:
LimitRequestBody 20480000
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value memory_limit 20M
php_value max_execution_time 600
php_value max_input_time 600

Thanks for your time.
Post Reply