Can't upload some images (HTTP upload via HTML Form)

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
dashifen
Forum Commoner
Posts: 35
Joined: Thu Feb 05, 2004 9:53 pm
Location: Champaign - Urbana, IL

Can't upload some images (HTTP upload via HTML Form)

Post by dashifen »

http://www.nano-cemms.uiuc.edu/imgtest.php *SITE REMOVED, SORRY*

That site shows two images. One of a group of people that won't upload and one of me that does. The exact same form was used to upload both images and as you can see, they both appear to be jpgs with no issues. I uploaded the top image (the one that doesn't want to work in the form) but hand over FTP and it was fine.

However, when trying to upload that image using a an <input type="file"> field in a form, one of two things happens:
  1. In Internet Explorer, a "This Page Cannot be Displayed" page is shown.
  2. In Mozilla (& FireFox), you click the submit button and nothing happens.
Now, when #2 happened before, I realized that Mozilla & FireFox were not uploading images that exceeded the MAX_FILE_SIZE hidden field of the form. So, I increased that files size and those images worked fine. However, the files size of the top graphic on the page linked above is only 49791 bytes and the limit is currently set to 1MB for testing purposes.

This has also happened with GIF files. The jpeg on the page linked above is the first JPEG that has caused this problem.

Here is the form and the relevant fields:

Code: Select all

<form method="post" action="pro_enter_data.php" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="file" size="100" name="image_file" class="bodytext">
</form>
There are no error messages thrown when #2 happens above. The stop button lights for a moment, showing me that the browser is trying to do sometihng, and then it stops. The page is not reloaded, nor does the browser seem to travel to pro_enter_data.php as the action field of the form would have you believe.
Last edited by dashifen on Fri Oct 22, 2004 8:45 am, edited 1 time in total.
dashifen
Forum Commoner
Posts: 35
Joined: Thu Feb 05, 2004 9:53 pm
Location: Champaign - Urbana, IL

Re: Can't upload some images (HTTP upload via HTML Form)

Post by dashifen »

One other thing. I have checked php.ini and set the maximum uploaded file size in the runtime configuration as well.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Maybe the script times out, try adding:

Code: Select all

set_time_limit(0);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

can you post the code of the submission form?

side note: you can edit your posts.. you don't have to reply to them. :)
Post Reply