Hi everyone, im new to AEM, i want to know that it is possible to create component filled with form input including file upload, and the uploaded file is gonna stored in dam (like if we manually upload asset using built-in asset file uploader menu in aem), is there any documentation or article that i can read ? thanks for your help.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @user06594 ,
Try to get the required file reference from component dialog and in code get the inputstream of the file and convert it to binary. The binary content need to be set as "jcr:data" property of asset node path wherever you wanted to store it. PFB sample code.
Regards,
Santosh
Hi @user06594 ,
Try to get the required file reference from component dialog and in code get the inputstream of the file and convert it to binary. The binary content need to be set as "jcr:data" property of asset node path wherever you wanted to store it. PFB sample code.
Regards,
Santosh
thanks for answering, CMIIW, so i need to get the file and then convert base64 and then convert it to binary, and send the binary reference to js-use ?
yes
Hi @santhosh_kumark,
I have almost the similar kind of question - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/upload-asset-to-dam-path-u...
Want to understand your answer : so, how would the asset be created in DAM path?
Can we use the Asset HTTP API in such cases?
Thanks in advance!
Views
Replies
Total Likes
Yes we can use Asset API. we need to append the binary payload/response in request body and it will upload in specified dam location.
Views
Replies
Total Likes