Hi All,
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.
Views
Replies
Total Likes
Hi @chetan001
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!
Thanks,
Kiran Vedantam.
you mean temp folder inside server where AEM is running.
If you use the API, it should automatically create a temp file for you. Use the below code
//Create
File sample = File.createTempFile("sample", ".pdf");
//Delete
Files.delete(sample.toPath());
Hope this helps.
Thanks,
Kiran Vedantam
ok, instead of download then upload to AEM Dam. can I direct use rest imgae url to upload to AEM DAM. any way ? what you think ?
So once you receive the data, you cant directly push it to AEM. You need to save it in temp location and push it to AEM
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.
What if I have a public web url? Can AEM do the heavy lifting on behalf of me?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies