Skip to main content
Level 2
April 16, 2024
解決済み

Some svg images not working with file upload field

  • April 16, 2024
  • 2 の返信
  • 1543 ビュー

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

このトピックへの返信は締め切られました。
ベストアンサー Raja_Reddy

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.

 

2 の返信

Raja_Reddy
Community Advisor
Community Advisor
April 16, 2024

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.

 

Abhilasha_S作成者
Level 2
April 16, 2024

Hi @raja_reddy ,

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

 

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