Hello All,
I need to write a component that does **file upload (restrict the upload file types to PDF only).**
I have seen CQ has its own dialogs to upload files, but I am not sure, whether I could resuse them.
Please let me know, if I could use out of the box xtypes "smartfile",
"fileuploadfield", "html5fileuploadfield", or "uploaddialogbutton"
with restriction to PDF files.
OR Do I need to write custom component extending one of the xtypes?
I appreciate all the help.
Thank you,
Sri
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Extending to what Scott has mentioned in reply,
You can create a custom uploading component, there you can write a logic to handling a particular type of extension that you would love to upload.
Some facts about PDF,
1. If you open PDF file in text pad or notepad, it will always start with "%PDF-<version>", so even if you don't want to check mine type or something, just read a line of file, and check if it is of "%PDF-<version>".
Link:- https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html
I hope this would act as some help to you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
you can use ddAccept property. define the MIME type of file which you want to allowed
Views
Replies
Total Likes
edubey wrote...
you can use ddAccept property. define the MIME type of file which you want to allowed
Thank you. ddAccept only works for drag and drop, for upload "mimeType" property works.
Either way, I could not use these OOTB components,as I need to have server side processing to store the files at a specific content dam location.
Views
Replies
Total Likes
See http://scottsdigitalcommunity.blogspot.ca/2013/07/uploading-files-to-adobe-experience.html
This shows server side.
Views
Replies
Total Likes
Hi
Extending to what Scott has mentioned in reply,
You can create a custom uploading component, there you can write a logic to handling a particular type of extension that you would love to upload.
Some facts about PDF,
1. If you open PDF file in text pad or notepad, it will always start with "%PDF-<version>", so even if you don't want to check mine type or something, just read a line of file, and check if it is of "%PDF-<version>".
Link:- https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html
I hope this would act as some help to you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies