Hi All,
I have a requirement to restrict and show a popup to my web masters to do not upload more than 20mb assets (png, jpg, tif .. etc but not pdf, zip), while I was searching web, I found this link https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-5-19-on-prem-restric....
I followed this, but I have couple of questions,
In continuation to achieve my requirement, I decided to overlay(/apps/dam/gui/content/assets/jcr:content/actions/secondary/create/items/fileupload) OOTB file upload component/JS as suggested by @EstebanBustamante in his response in the above question and here also https://experienceleague.adobe.com/en/docs/experience-manager-65/content/assets/managing/managing-vi...
After overlay, my could see a popup with my custom sizelimit, which is good.
But, the problem is I’m not able apply this restriction only for Images(png, jpg, tif .. etc but not pdf, zip).
Is there a different way to achieve this or property at fileUpload (when I checked library I didn’t find any such) to limit to only specific MIME types?
Thanks,
Raju.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @arunpatidar ,
Thanks for your response.
Yes, I did try that overlay of /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js but the challenge here is,
The “.on("dam-fileupload:filesizeexceeded", function(event) “ is triggered to show the error popup and this is being triggered from “/libs/clientlibs/granite/coralui3/js/all.js”
// Check file size
if (self.sizeLimit && item.file.size > self.sizeLimit) {
self.trigger('coral-fileupload:filesizeexceeded', {
item: item
});
}
}
I think, we are not supposed to overlay/customize files of this location, correct?
Otherwise I would have overlayed the above size check function, that would have solved my issue mostly.
I’m stuck here!
Correction- I found there is different file which is triggering the size exceeded event, please find the files below
I did overlay these files with a custom sling servlet (to expose config details to access in JSs) + OSGI config (to configure Image MIME types, Max size)
Apologies for the confusion.
Thanks,
Raju.
Hi @Rajumuddana
Please check fileupload js overlay if you can check the extension and size there.
File detail is at - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/handle-various-tif-extensi...
Hi @arunpatidar ,
Thanks for your response.
Yes, I did try that overlay of /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js but the challenge here is,
The “.on("dam-fileupload:filesizeexceeded", function(event) “ is triggered to show the error popup and this is being triggered from “/libs/clientlibs/granite/coralui3/js/all.js”
// Check file size
if (self.sizeLimit && item.file.size > self.sizeLimit) {
self.trigger('coral-fileupload:filesizeexceeded', {
item: item
});
}
}
I think, we are not supposed to overlay/customize files of this location, correct?
Otherwise I would have overlayed the above size check function, that would have solved my issue mostly.
I’m stuck here!
Correction- I found there is different file which is triggering the size exceeded event, please find the files below
I did overlay these files with a custom sling servlet (to expose config details to access in JSs) + OSGI config (to configure Image MIME types, Max size)
Apologies for the confusion.
Thanks,
Raju.
Hi @Rajumuddana
That true that we are not suppose to change anything within /libs
maybe you can check /libs/dam/gui/coral/components/commons/fileupload/action/render.jsp and try overlay if works.