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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.