Hi Team,
I want to create a workflow to accept the file in the frontend page upon clicking the button. the files should be uploaded to the dam.
can anyone help on it (any sample code will be helpful).
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
I would follow the below steps for the above mentioned requirements -
1. I will create a File Upload component with the ability for the user or the author to browse the file.
2. Upon clicking on upload button I will make post request from File Upload component to custom servlet to trigger my workflow. In this servlet I will capture that uploaded file name and construct payload path as mentioned here -
https://aem.redquark.org/2019/12/workflows-in-aem-05-trigger-workflow.html
3. Finally my custom workflow model(process step) will upload the files to the DAM using below approach -
Please consider one more point if someone try to upload same file then do you want to show any message.
Is there any specific reason you want to write workflow here?
I feel without having workflow you can achieve the same.
You can make post request while uploading the file to custom servlet and that will persist the file in DAM using AssetaManager API.
Please review below method to perform upload operation-
Hope it will help you.
Hi @DEBAL_DAS
My requirement is to create a workflow to upload files to the DAM.
and user should be able to use it from the page.
let's say a component. and it should give the ability for the user or the author to browse the file and upon clicking on the button it should upload the image to the DAM.
Thanks.
I would follow the below steps for the above mentioned requirements -
1. I will create a File Upload component with the ability for the user or the author to browse the file.
2. Upon clicking on upload button I will make post request from File Upload component to custom servlet to trigger my workflow. In this servlet I will capture that uploaded file name and construct payload path as mentioned here -
https://aem.redquark.org/2019/12/workflows-in-aem-05-trigger-workflow.html
3. Finally my custom workflow model(process step) will upload the files to the DAM using below approach -
Please consider one more point if someone try to upload same file then do you want to show any message.