• Resolved rui9075918

    (@rui9075918)


    Good afternoon,

    Is there any way to prevent the uploading of images when they are smaller than intended?

    I have two functions to check the dimensions: (function(){
    var size = IMGDIMENSION(fieldname17|n);
    return size[‘height’];
    })()
    in this case it is for the width, and I have another identical one for the height, with the necessary changes. But only after uploading the file does it check, of course.

    I’d like to know if it’s possible to abort the upload process if you don’t check the minimum dimensions.

    Can you help?

    Best Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @rui9075918

    The IMGDIMENSION operation checks the images’ sizes directly in the browser before uploading them.

    So, assuming the “Upload File” field is the fieldname1, you can insert a calculated field in the form as an auxiliary and enter the following piece of code as its equation:

    (function(){
    let size = IMGDIMENSION(fieldname1|n);
    if(
        AND(
            OR(size['height'],size['width']),
            size['height'] < 300,
            size['width'] < 300
        )
    ){
        getField(fieldname1|n).setVal('', true);
        alert('The image size is not accepted');
    }
    })()

    Please, note we are not allowed to support any customers in these forums, and the upload files feature is a commercial feature.

    For pro or commercial product support please contact us directly on our site. This includes any pre-sales topics as well.

    Commercial products are not supported in these forums. We will happily answer this and any other questions you can have on our own site.

    Thank you.

    Thread Starter rui9075918

    (@rui9075918)

    Thanks a lot for the quick response. This is what I intended.

    Best Regards

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

The topic ‘Upload files “images”’ is closed to new replies.