I am integrating AEM with rest service which is providing image/asset urls . using this url ,I have to get image and this image should upload to AEM DAM System.
I am planning to download image in aem root/folder path using http client api. Then using AEM Assets http Api will upload to dam folder.
Is this approach fine ?
Could you please share best approach to implement this kind of scenario.
Appreciate your comments.
After downloading the assets, instead of downloading and keeping it in root folder, create temp file, push it to AEM DAM and delete the temp file.
You can use java.io.file API for this.
Hope this helps!
If you use the API, it should automatically create a temp file for you. Use the below code
File sample = File.createTempFile("sample", ".pdf");
Hope this helps.
Hi @chetan001 ,
If the REST API is providing you Image data in binary format then you can directly use AEM Asset API to upload the asset in AEM.
You need to pass the binary data in request body and Asset API will upload it in specified location.
Kindly let me know in case of any concerns.