AEM Coral UI FileUpload | Issue when empty file was uploaded on valid file | Community
Skip to main content
Level 2
September 23, 2021
Solved

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

  • September 23, 2021
  • 2 replies
  • 1203 views

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohit-Negi

Hi @shikhasharma-1 ,

 

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!

2 replies

Rohit-Negi
Rohit-NegiAccepted solution
Level 3
September 23, 2021

Hi @shikhasharma-1 ,

 

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!

Sanjay_Bangar
Community Advisor
Community Advisor
September 24, 2021

Hi @shikhasharma-1 ,

               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