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

How to decline image upload when the size of the image is more than the expected?

Avatar

Level 2

Hi,

I want to stop the image upload and show an alert message to the author when the image size is more than certain number?

thanks

Srini

1 Accepted Solution

Avatar

Correct answer by
Level 10

Write a custom Sling Servlet that uploads DAM Assets. In the Sling Servlet - use the Asset Manager API. You have full control and if the asset is larger than you want, you can prevent it from going into the DAM. See this article on how to use Asset Manager API: 

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

Hope this helps... 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Write a custom Sling Servlet that uploads DAM Assets. In the Sling Servlet - use the Asset Manager API. You have full control and if the asset is larger than you want, you can prevent it from going into the DAM. See this article on how to use Asset Manager API: 

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

Hope this helps... 

Avatar

Administrator

Hi 

Also have a look at this old forum thread :- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

//there is a community article for restricting the upload based on size of the file - http://experience-aem.blogspot.com/2014/12/aem-6-sp1-classic-ui-restrict-large-or-small-files-upload.... You can customize it and add your logic of checking the file types. You can either just check the file extensions in the javascript or invoke a backend servlet to check the file headers for the mime types. Also, this is limited to Classic UI only. 

 

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

//

Yes, we can configure the Size limit of the assets.

Please find below the way of doing so:-

  1. In AEM, touch Tools > CRXDE Lite.
  2. In the CRXDE Lite page, in the directory window on the left, navigate to /jcr_root/apps/dam.
  3. You may need to touch the >> icon to see the directory window.
  4. In the /jcr_root/apps/dam folder, use the Create(if not present) drop-down list to create a node with the following directory structure:
    /gui/content/assets/_jcr_content/body/assetscontent/header/items/items/fileupload (it may be already present).
  5. When you are finished creating the node, the full path appears as the following:
  6. /jcr_root/apps/dam/gui/content/assets/_jcr_content/body/assetscontent/header/items/items/fileupload
  7. Select the fileupload node, then in the Properties tab, enter the following property value:
  8. {sizeLimit : "32212254720"}
  9. “chunkUploadMinFileSize property”:- The size above which an asset is considered a large asset.  You can configure the system to consider assets above 30 Mb (instead of 50 Mb) in size as large assets. In other words, the progress bar appears when assets above 30 Mb in size are uploaded.
  10. In the upper-left of the CRXDE Lite page, touch Save All.

 

Reference Links

1. https://docs.adobe.com/docs/en/aem/6-0/author/assets/managing-assets-touch-ui/managing-video-assets....

2. https://docs.adobe.com/docs/en/aem/6-1/author/assets/managing-assets-touch-ui.html

 

This is the way to configure the limit of assets.

I hope this will solve your problem.

 

Thanks and Regards

Kautuk Sahni



Kautuk Sahni