Support

Account

Home Forums Front-end Issues Image dimension validation not working correctly

Helping

Image dimension validation not working correctly

    • nuideas

    • January 5, 2019 at 9:51 pm

    Hi,
    I have a front-end image upload form in my website which had worked fine, but is now experiencing problems.

    In the form config, I have the minimum dimensions set to 900px. During upload any image less than 900px is prevented from being uploaded, but no error message is displayed and the success message is shown, leading users to believe their image has been uploaded when it hasn’t.

    This only happens on the front end. Back end admin upload displays the error message.

    I have tried switching to a default theme and deactivating all other plugins and get the same results.

    I am using this code:
    $new_post= array(
    ‘post_id’ => ‘user_’.$current_user->ID,
    ‘field_groups’ => array(8506),
    ‘form’ => true,
    ‘return’ => add_query_arg( ‘updated’, ‘true’, get_permalink() ),
    ‘html_before_fields’ => ”,
    ‘html_after_fields’ => ”,
    ‘submit_value’ => ‘Upload Logo’,
    ‘updated_messag’ => ‘Saved!’
    );
    acf_form( $new_post);

    The file type validation works perfectly. It is just the dimensions that is a problem. Any ideas? Thanks.

    • Troglos

    • January 12, 2020 at 12:05 am

    I am having the same issue.

    I’m using the validation code from here https://www.advancedcustomfields.com/resources/acf-validate_value/ to prevent uploading images < 960px but it blocks every photo even those > 960px

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.