Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How do I limit the field image?

Avatar

Level 4

Hi.

Is possible I create a image field with limit of image size?


Example: I don't want that image pass of 300KG. Is possbile?

Another question
How do I do see this image in another page?

Example: The user will select the image at the page 1, but the image only will show at the page two.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The image size issue came up before and a solution is here: ImageField Content Size

Good luck,

Niall

View solution in original post

4 Replies

Avatar

Former Community Member

When a user picks an image for the image field you cannot restrict the ability to limit to a certain file size.

For your second question, if you make the image fields the same name and set the binding as global then all fields that have the same name will have the same image data.

Hope that helps

Paul

Avatar

Correct answer by
Level 10

Hi,

The image size issue came up before and a solution is here: ImageField Content Size

Good luck,

Niall

Avatar

Level 4

NOTE: The correct is 300KB and not 300KG

Avatar

Level 4

It works!!!!

See my script

if

(this.value.image.value.length > 417350)

{

this.rawValue

= null;

app.alert("Por favor, escolha uma foto com no máximo 300kb");  

}

I am very happy!

Thanks!! Especially for my friend Niall!! You are fantastic!!!!!!