Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to create a metadataschema which allowd only svg images?

Avatar

Level 3

I am looking to create a folder in DAM and impose restriction to it such that we can add only SVG images to it. Hence I am trying to create a metadataschema which allows only svg in images and planning to add  this as 'metadataSchema' property to my DAM folder so that this restriction is in place.

Can some one help me how I can create a metadataschema which will allow only svg as image?

We already have a metadataschema which allows jpeg and tiff. Can I create a copy of that? If so, what changes to make so that this allows only svg images?

 
 

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

metadataschema defines the layout for the page properties for the assets, I am doubtful it you can actually disallow a particular asset/file type to be allowed or restricted using this. But you can define the layout specific to an asset/file type if you need to capture any specific metadata info for it.

 

The only option , I can think is to create a folder metadata schema , to configure the supported file formats for the folder and customise the asset upload workflow to check if a specific file type can be uploaded or not.

 

Just curious to know, why would you want to restrict a specific file type to be uploaded to a folder, a well structured content folders and naming convention should be good enough to guide the content editor to place the assets in the correct folder.

View solution in original post

7 Replies

Avatar

Correct answer by
Level 5

metadataschema defines the layout for the page properties for the assets, I am doubtful it you can actually disallow a particular asset/file type to be allowed or restricted using this. But you can define the layout specific to an asset/file type if you need to capture any specific metadata info for it.

 

The only option , I can think is to create a folder metadata schema , to configure the supported file formats for the folder and customise the asset upload workflow to check if a specific file type can be uploaded or not.

 

Just curious to know, why would you want to restrict a specific file type to be uploaded to a folder, a well structured content folders and naming convention should be good enough to guide the content editor to place the assets in the correct folder.

Avatar

Level 3
This requirement is specific to one folder only. There is a component with some logos configured, business would like to upload only SVG images as logos. So we are planning to create a dedicated folder for SVG logos. So inside project dam folder, only one specific folder needs to be restricted to allow only SVG images. So don't think amending workflow will help here

Avatar

Level 3
So are you saying we cannot create a metadaschemavti allow only SVG images and then attach this metadata schema as a property to the specific dam folder?

Avatar

Employee
What does metadata have to do with anything here? Restrict the folder by MIME type.

Avatar

Level 3
Can you please advise on the steps? How can I restrict the dam folder using mime type?

Avatar

Level 3

@aemmarcCan you please advise on the steps? How can I restrict the dam folder using mime type?Is it simple like adding a property at dam folder jc:content?

Avatar

Community Advisor

Hi, I don't think so you can restrict this using a metadata profile or schema. This can be restricted using config but this is global https://techrevel.blog/2020/01/24/asset-upload-restrictions/

 

In your case, you can write a custom javascript and call on save/upload button. This Js will check the mime type and return false with an error message. The code can be executed based on a path.

 

 



Arun Patidar