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

Issue while uploading multiple assets inside DAM

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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. 

View solution in original post

9 Replies

Avatar

Level 10

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

Avatar

Level 4

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

Avatar

Level 10

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);

Avatar

Level 10

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. 

Avatar

Level 10

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. 

Avatar

Level 4

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

Avatar

Correct answer by
Level 10

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. 

Avatar

Level 1

Hey @smacdonald2008,

 

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

Avatar

Level 4

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?