Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Asset upload code for AEMaaCS

Avatar

Level 5

Hi, we have asset upload servlet currently running on on-Prem version. Now plan to migrate it to AEMaaCS. Few APIs are deprecated and needs to use Cloud APIs for asset upload, delete activities. Anyone can you share asset upload functionality sample which would be compatible when deployed onto AEMaaCS with cloud api.

Really appreciate, if anyone  can share their pointers around it.

8 Replies

Avatar

Community Advisor

Hello @rsl_lucky ,

Please follow this article on how to upload assets to AEMaaCS. 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

 

 

Here is an overview of the process:

In Experience Manager as a Cloud Service, you can directly upload the assets to the cloud storage using HTTP API. The steps to upload a binary file are below. Execute these steps in an external application and not within the Experience Manager JVM.

  1. Submit an HTTP request. It informs Experience Manager deployment of your intent to upload a new binary.
  2. PUT the contents of the binary to one or more URIs provided by the initiation request.
  3. Submit an HTTP request to inform the server that the contents of the binary were successfully uploaded.

 

Here is a sample code snippets that explain "how to",

https://github.com/adobe/aem-upload

 

Hope that helps!

 

regards,

Preetpal Singh

Avatar

Level 5

Hi @Preetpal_Bindra  thanks for above information, went through those articles but unclear on approach were to kick start.

Currently aem 6.5 on-Prem version holds a servlet built with AssetManager api and it does the job of upload & delete of assets from repository. Now plan to move for AEMaaCS so in that case this servlet doesn't perform it's job as expected.

Needs to upgrade existing servlets to support AEMaaCS what are the steps need to be taken care here. Really appreciate if any inputs here that would help.

Avatar

Community Advisor

Aem asset create api is deprecated on aem cloud and it’s because of the reason that assets now don’t resides  on aem repository instead the binary go to s3 bucket so your existing servlet won’t work for aem cloud.

it seems for your use case you can either use asset upload api as explained on https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo... or open source upload library mentioned on the above article 

Avatar

Level 5

Thanks @DPrakashRaj  for the above details.

Can we have any sample steps for the approach to follow in my use case has currently servlet takes care of assets upload job for me. Please let me know the step by step process for the same.

Avatar

Level 5

Thanks @DPrakashRaj for the above info.

Came across below sample which does the 3-step process of assets upload but do not see any inputs params like fil I/p & others set while binary upload PUT, asset completion POST requests are made.

https://experiencing150.rssing.com/chan-25971229/article426.html

 

Could you let us know if this can be followed and what extra inclusion is required.

 

Avatar

Administrator

@rsl_lucky 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.



Kautuk Sahni

Avatar

Level 5

Awaiting users confirmation on further resolution required on other different discussion threads as part of the solution, it can be resolved.