Jump to content

[SOLVED] Trouble Validating Very Large Images?


brent123456

Recommended Posts

I can't seem to validated a very large image when uploading. I have tried checking the file size but it the image is like 3 megabytes then it just returns 0 for the byte size. I have tried checking $_FILE[the_image][error] and it will not validate the image either. The code below is working..

 $large = false;
         if ($_FILES['image']['size'] > 220000) {
            $large = true;
        }
        echo $_FILES['image']['size'];
        echo $_FILES['image']['error'];
        if ($_FILES['image']['error'] > 0) {
            $large = true;
        }
        
        // check for image
       
        if (is_uploaded_file($_FILES['image']['tmp_name'])) {
       

 

The trouble is that users don't have to upload a picture when they submit. This is not allowing them to submit without an image file. When I add the code below the

if (is_uploaded_file($_FILES['image']['tmp_name']))

it doesn't work at all. Does anyone have a better way to check if a user has uploaded a file and just not do anything it user has not added an image? Thanks, Brent

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.