Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Some svg images not working with file upload field

Avatar

Level 2

Some svg images are not showing up in the asset preview and not working when we drag and drop in the file upload field.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Abhilasha_S 

There could be a few reasons why SVG images are not showing up in the asset preview or not working when dragged and dropped into the file upload field.

1. MIME Type Configuration: Check if the MIME type for SVG images is properly configured in your AEM instance. AEM uses MIME types to determine how to handle different file types. Make sure that the MIME type for SVG images is correctly set to "image/svg+xml". You can check and update the MIME type configuration in the AEM Web Console.

2. Asset Handler Configuration: Verify that the asset handler for SVG images is properly configured. The asset handler is responsible for processing and rendering different types of assets. Ensure that the SVG asset handler is correctly configured to handle SVG images. You can check and update the asset handler configuration in the AEM Web Console.

3. Security Policies: Check if there are any security policies in place that restrict the upload or rendering of SVG images. AEM has security policies that control what types of files can be uploaded and rendered. Make sure that SVG images are allowed by the security policies. You can review and update the security policies in the AEM Web Console.

4. Browser Compatibility: Test the SVG images in different browsers to see if the issue is browser-specific. Some browsers may have stricter security policies or limitations when it comes to rendering SVG images. Ensure that the SVG images are compatible with the browsers you are using.

 



View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Abhilasha_S 

There could be a few reasons why SVG images are not showing up in the asset preview or not working when dragged and dropped into the file upload field.

1. MIME Type Configuration: Check if the MIME type for SVG images is properly configured in your AEM instance. AEM uses MIME types to determine how to handle different file types. Make sure that the MIME type for SVG images is correctly set to "image/svg+xml". You can check and update the MIME type configuration in the AEM Web Console.

2. Asset Handler Configuration: Verify that the asset handler for SVG images is properly configured. The asset handler is responsible for processing and rendering different types of assets. Ensure that the SVG asset handler is correctly configured to handle SVG images. You can check and update the asset handler configuration in the AEM Web Console.

3. Security Policies: Check if there are any security policies in place that restrict the upload or rendering of SVG images. AEM has security policies that control what types of files can be uploaded and rendered. Make sure that SVG images are allowed by the security policies. You can review and update the security policies in the AEM Web Console.

4. Browser Compatibility: Test the SVG images in different browsers to see if the issue is browser-specific. Some browsers may have stricter security policies or limitations when it comes to rendering SVG images. Ensure that the SVG images are compatible with the browsers you are using.

 



Avatar

Level 2

Hi @Raja_Reddy ,

Some of the svg files are working fine and for the ones which are not working has correct mimetype 

Abhilasha_S_1-1713283552812.png

 

I do see below error in the logs but it renders correctly when directly used in the html

The attribute "offset" of the element <stop> is required