Expand my Community achievements bar.

SOLVED

sizelimit on fileupload

Avatar

Level 1

I have a requirement to set size limit of 50KB on fileuplod of type image that i drag and drop from asset.I have tried sizeLimit property but it did not work,can someone help me on this.i found many examples to set restriction on dam asset but this requirement is component specific.

1 Accepted Solution

Avatar

Correct answer by
Administrator

jainamita wrote...

Thanks for your reply but i am using drop-zone to drag & drop images and file-upload is disabled. (please see the attachment)

 

 

In that case i would suggest you to write a custom DAM workflow.

If you refer the OOB workflow 'DAM Update Asset' workflow, there you can configure which file types should be allowed. Similarly, you can write custom workflowprocess service to check the type and size of the asset and restrict the uploads accordingly.

Example of creating a custom workflow:- https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

// Creating custom AEM workflow steps that send email messages

You can create this for your use-case as well.

~kautuk



Kautuk Sahni

View solution in original post

4 Replies

Avatar

Level 10

If you want a size limit for a specific component - then write a custom sling servlet that handles the upload of the content. Before placing the content into the JCR - check to see if the size of the asset. If its too big - reject it.  

Avatar

Administrator

Hi 

Please have a look at the suggestions from my AEM experts on similar question :

Link:-  http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// Restrict file uploads by size & type in DAM upload dialog  

    Link:- http://experience-aem.blogspot.in/2014/12/aem-6-sp1-classic-ui-restrict-large-or-small-files-upload....

    Or

    You could create a custom sling servlet, that will upload assets for you. There you can insert you logic to restrict anything.

    Link:- https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html

 

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// DAM limit file size

 

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// AEM TOUCH UI Restrict Large or Small Files Upload

 

I hope this would help you.

~kautuk



Kautuk Sahni

Avatar

Level 1

Thanks for your reply but i am using drop-zone to drag & drop images and file-upload is disabled. (please see the attachment)

Avatar

Correct answer by
Administrator

jainamita wrote...

Thanks for your reply but i am using drop-zone to drag & drop images and file-upload is disabled. (please see the attachment)

 

 

In that case i would suggest you to write a custom DAM workflow.

If you refer the OOB workflow 'DAM Update Asset' workflow, there you can configure which file types should be allowed. Similarly, you can write custom workflowprocess service to check the type and size of the asset and restrict the uploads accordingly.

Example of creating a custom workflow:- https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

// Creating custom AEM workflow steps that send email messages

You can create this for your use-case as well.

~kautuk



Kautuk Sahni