Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM Coral UI FileUpload | Issue when empty file was uploaded on valid file

Avatar

Level 2

Hi All,

We have a requirement where we are allow author to upload a file from their local system in AEM. For this we are using OOTB AEM /libs/cq/gui/components/authoring/dialog/fileupload.

It worked fine when their is no file selected previously and author tries to upload a empty file in authoring instance. AEM validate the file and doesn't upload it in the JCR. No node created for it.

 

Where as in case when author first selected a valid file with data in it and on top it upload an empty file (0 KB). In this scenario AEM is not validating the empty file and allow the author to upload it. 

But in corresponding JCR node the old file with data still attached.

 

So just want to understand how AEM validate the empty file and is their any way we can restrict the Author to upload empty file in second scenario as well.

 

Thanks in advance.

Regards,

Shikha

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @sharms13 ,

 

You can overlay this component and update the file: http://<IP>:<Port>/libs/cq/gui/components/authoring/dialog/fileupload/render.jsp

 

You can have a check for the size of doc at the time of upload and accordingly can intimate the Author at the time of upload(may be by an alert).

 

 

Thanks!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

Hi @sharms13 ,

 

You can overlay this component and update the file: http://<IP>:<Port>/libs/cq/gui/components/authoring/dialog/fileupload/render.jsp

 

You can have a check for the size of doc at the time of upload and accordingly can intimate the Author at the time of upload(may be by an alert).

 

 

Thanks!

Avatar

Community Advisor

Hi @sharms13 ,

               Write validation logic in  js and add property name validation  to the particular field.whenever you have selected file it will validate is it empty file or not .

Kr,

Sanjay