sizelimit on fileupload | Community
Skip to main content
jainamita
New Participant
December 20, 2016
Solved

sizelimit on fileupload

  • December 20, 2016
  • 4 replies
  • 2819 views

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.

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 kautuk_sahni

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

4 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
December 22, 2016

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
jainamita
jainamitaAuthor
New Participant
December 21, 2016

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

kautuk_sahni
Employee
December 21, 2016

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-manager.topic.html/forum__ibof-we_have_a_requiremen.html

// 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.html

    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-manager.topic.html/forum__nciy-hi_i_have_arequ.html

// DAM limit file size

 

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__bepz-hi_i_got_theref.html

// AEM TOUCH UI Restrict Large or Small Files Upload

 

I hope this would help you.

~kautuk

Kautuk Sahni
smacdonald2008
New Participant
December 20, 2016

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.