Hi,
I am unable to download the custom assets from AEM assets console but I am able to download the same assets from damadmin.
Not sure if I am missing any configuration.
Thanks,
Jitendra
Solved! Go to Solution.
Views
Replies
Total Likes
here is the shell script example to upload assets in AEMaaCS
The new upload method is supported only for Adobe Experience Manager as a Cloud Service. The APIs from Adobe Experience Manager 6.5 are deprecated. The methods related to upload or update assets or renditions (any binary upload) are deprecated in the following APIs:
AssetManager
Java API, like AssetManager.createAsset(..)
, AssetManager.createAssetForBinary(..)
, AssetManager.getAssetForBinary(..)
, AssetManager.removeAssetForBinary(..)
, AssetManager.createOrUpdateAsset(..)
, AssetManager.createOrReplaceAsset(..)
Ji,
Please check Download assets
Let us know what issue you are facing with screenshots, that would help.
Hi Arun,
We are uploading bulk assets into AEM from some other tool.
I have observed that I was using below asset manager api to create assets.
com.adobe.granite.asset.api.AssetManager
com.adobe.granite.asset.api.Asset asset = assetMgr.createAsset(absTargetPath);
But, the assets were uploaded with 0B size and that might be the reason why I was not able to download them in AEM asset console and also, they are not accessible directly on browser.
So, now I have used "com.day.cq.dam.api.AssetManager" api
com.day.cq.dam.api.Asset asset = assetMgr.createAsset(absTargetPath, is, mimeType, true);
Now, the assets are correctly uploaded with correct size and are now able to download as well.
I am not sure why granite Asset Manager api is not uploading assets properly but the reason I have used granite api is- I am doing the asset relation through code and I can only able to do that by using granite api, I am not sure if dam api has any option for creating asset relation.
AEM version : AEM 6.4
Thanks,
Jitendra
Hi,
The granite Api, doesn't have method to read assets from filesystem.
It has only one parameter which is repo path where Asset would be created.
It is missing InputStream param.
AssetManager assetManager = resolver.adaptTo(AssetManager.class);
Asset newAsset = assetManager.createAsset("/path/to/asset/document.pdf");
For creating Asset, you can use com.day.cq.dam.api.AssetManager
Hi Arun,
Yes, the granite Api doesn't have method to read assets from fielsystem. So I have used com.day.cq.dam.api.AssetManager for creating assets.
Also, I have used granite api for asset relate/un-relate because com.day.cq.dam.api.AssetManager doesn't have method for asset relation.
Please let me know if this approach is fine, where we can use both api's (one for creating assets from filesystem and second for creating asset relation).
Currently, this solution is working fine for me.
Thanks,
Jitendra
Hi,
Yes, it's fine to use CQ API instead Granite API.
for example Granite Workflow API doesn't have method to get session from workflow session but CQ API has, so we do use API according to the requirement.
@arunpatidar - The CQ Asset API is now deprecated in Cloud. So have to use Granite Asset API. In that case the above issue will occur again. Is there a way to create an asset using Granite Asset API with the right metadata. As per the Adobe API DOC, there is not method of Asset as well to do this. Please confirm.
@arunpatidar We have a code which uses CQ Asset API to create assets in the DAM programmatically. Is the asset upload the only programmatic solution available now or Granite Assets API can be used. I don't want to go via AEM developer console to upload the assets due to time constraints.
FYI @ritik_r
here is the shell script example to upload assets in AEMaaCS
The new upload method is supported only for Adobe Experience Manager as a Cloud Service. The APIs from Adobe Experience Manager 6.5 are deprecated. The methods related to upload or update assets or renditions (any binary upload) are deprecated in the following APIs:
AssetManager
Java API, like AssetManager.createAsset(..)
, AssetManager.createAssetForBinary(..)
, AssetManager.getAssetForBinary(..)
, AssetManager.removeAssetForBinary(..)
, AssetManager.createOrUpdateAsset(..)
, AssetManager.createOrReplaceAsset(..)
@jitendra_m Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Like
Replies