Issue while uploading multiple assets inside DAM | Community
Skip to main content
Level 4
Sep 26, 2016 12:06 PM UTC
Solved

Issue while uploading multiple assets inside DAM

Hi,

I have followed (https://helpx.adobe.com/experience-manager/using/multiple-digital-assets.html) article to upload multiple assets inside DAM.

Once I started uploading files, I have got the below error :

26.09.2016 17:32:40.143 *ERROR* [Thread-55] com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl error while executing folder thumbnail update job 
java.lang.IllegalArgumentException: width or height <= 0
    at com.day.image.Layer.init(Layer.java:3149)
    at com.day.image.Layer.<init>(Layer.java:490)
    at com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator$FolderPreviewCreator.createPreview(FolderPreviewGenerator.java:291)
    at com.day.cq.dam.core.impl.ui.preview.AssetDrivenFolderPreviewGenerator.generate(AssetDrivenFolderPreviewGenerator.java:231)
    at com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.updateFolderThumbnail(FolderPreviewUpdaterImpl.java:97)
    at com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.run(FolderPreviewUpdaterImpl.java:144)
    at java.lang.Thread.run(Unknown Source)

I have also tried by installing the HF- 3921, still the same error keep occuring. Currently I am using AEM 6-1. Please help me out, to resolve this issue.

Regards,

Krishh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Sep 27, 2016 11:43 AM UTC

You can attempt to extend the client app to read the MIME type of each file that you reference in the XML file. That way - you are not manually setting the MIME type via the drop-down control in the Client app- but dynamically reading each file with Java. 

The Asset Manager method that places the asset in the DAM needs the MIME type. Getting the MIME type via the drop-down was an example of uploading JPG files. But if you want to upload 1000s of files - with different MIME types - try modifying the code in the Client Java app to read the MIME Type of each file. 

http://www.rgagnon.com/javadetails/java-0487.html

Hope this helps. 

9 replies

Level 3
Mar 7, 2018 4:38 PM UTC

Am trying to read the CSV file from the Dam location. Am getting the same error.

The mime type while uploading the csv i gave as "text/csv".

May i know how to resolve it?

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Sep 27, 2016 11:43 AM UTC

You can attempt to extend the client app to read the MIME type of each file that you reference in the XML file. That way - you are not manually setting the MIME type via the drop-down control in the Client app- but dynamically reading each file with Java. 

The Asset Manager method that places the asset in the DAM needs the MIME type. Getting the MIME type via the drop-down was an example of uploading JPG files. But if you want to upload 1000s of files - with different MIME types - try modifying the code in the Client Java app to read the MIME Type of each file. 

http://www.rgagnon.com/javadetails/java-0487.html

Hope this helps. 

Translate
New Participant
Oct 28, 2021 10:47 AM UTC

Hey @smacdonald2008,

 

Thanks for the clue. This helped a lot, saved my day!

Translate
Level 4
Sep 27, 2016 6:46 AM UTC

smacdonald2008 wrote...

This works fine on AEM 6.1. See this HELPX video: 

https://www.youtube.com/watch?v=smrFuVLfiBc&feature=youtu.be

I think your issue is because the MIME type did not match. The Sling Servlet did not successfully use the AssetManager API properly. 

 

 

Hi Smac,

Thanks a lot for your response. Today I morning, I have repeated the same steps, magically image was uploaded. but still I am getting the same error in error log.

Regarding, different MIME Types, I have to maintain different xml files right? I have to update DAM with an around 100GB of files. Is this process is efficient?

once again thanks a lot for your quick response.

Regards,

Krishh

Translate
smacdonald2008
Level 10
Sep 26, 2016 8:37 PM UTC

This works fine on AEM 6.1. See this HELPX video: 

https://www.youtube.com/watch?v=smrFuVLfiBc&feature=youtu.be

I think your issue is because the MIME type did not match. The Sling Servlet did not successfully use the AssetManager API properly. 

Translate
smacdonald2008
Level 10
Sep 26, 2016 8:02 PM UTC

This works on AEM 6.1. You said that you have different MIME types - make sure that for each group of MIME types - you are building a separate XML file. When posting files from the client - you are selecting 1 XML file (that contains the files where each file is the same MIME type - ie, image/jpeg)  and you are specifying the MIME type of the files in the Client. 

I have created a video of this and will post the URL to the video soon. 

Translate
smacdonald2008
Level 10
Sep 26, 2016 6:28 PM UTC

This application posts the files to a slign servlet that uses the AssetManager API. The API then places the Assets in the DAM. Use of the AssetManager API is a valid use case. The article was tested in AEM 6.0.

I will see if there is an issue with 6.1/6.2. 

Here is the AssetManager API call in the servlet: 

 //Use AssetManager to place the file into the AEM DAM
    com.day.cq.dam.api.AssetManager assetMgr = resourceResolver.adaptTo(com.day.cq.dam.api.AssetManager.class);
    String newFile = path+fileName ; 
    assetMgr.createAsset(newFile, is, mimetype, true);

Translate
Level 4
Sep 26, 2016 5:26 PM UTC

smacdonald2008 wrote...

What tyoe if assets are you upliading and how many? When this was tested, we used images. 

 

Hi Smac,

I tried to upload an image file. I have tested with only one image file. After installing hotfix also getting the same error. In my Requirement assets might contain pdf,doc,docx,images,videos.Thanks for the reply.

please suggest me a better approach.

Regards,

Krishh

Translate
smacdonald2008
Level 10
Sep 26, 2016 4:30 PM UTC

What tyoe if assets are you upliading and how many? When this was tested, we used images. 

Translate