Expand my Community achievements bar.

Why does sizeLimit not working in AEM while dragging file from asset?

Avatar

Level 2

I'm trying to implement sizeLimit in cq:dialog of component. But sizeLimit is working only while I upload a file. It's not working while I drag a file from asset. Can I apply sizeLimit while dragging file from asset?

 

 

<file
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
sizeLimit="100"
autoStart="{Boolean}false"
class="cq-droptarget"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
mimeTypes="[image/gif,image/jpeg,image/png,image/webp,image/tiff,image/svg+xml]"
multiple="{Boolean}false"
name="./file"
title="Upload Image Asset"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"/>
3 Replies

Avatar

Community Advisor

you need to write a custom sling servlet that handles the upload of the asset. Before placing the content into the JCR - check to see if the size of the asset is according to your requirement. If not then reject it.  

Avatar

Level 2

So sizeLimit = " 100000" can't be implemented while dragging file from asset to component?