AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate file names) | AEM Community Blog Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

04-02-2021

BlogImage.jpg

AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate fil... by Sreekanth Choudry Nalabotu

Abstract

AEM Cloud Service Version : 2021.1.4738.20210107T143101Z-201217 (Jan 7, 2021)

Goal
Adding the following extension would restrict users from uploading duplicates files (files with same name). The check is done repository wide /content/dam

Solution
1) Create a service user configuration in repo init script ui.config\src\main\content\jcr_root\apps\eaem-cs-upload-unique-assets\osgiconfig\config.author\org.apache.sling.jcr.repoinit.RepositoryInitializer-eaem.config this is for querying and returning duplicates as JSON (in next steps).

scripts=[
"
create service user eaem-service-user with path system/cq:services/experience-aem
set principal ACL for eaem-service-user
allow jcr:read on /apps
allow jcr:read on /content/dam
end
"
]

2) Adding the above repo init script in code repo and installing on AEM CS creates a service user in /home/users/system/cq:services/experience-aem

3) Add the service user to bundle mapping in ui.config\src\main\content\jcr_root\apps\eaem-cs-upload-unique-assets\osgiconfig\config.author\org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-eaem.xml


Read Full Blog

AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate fil...

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager