Some svg images not working with file upload field | Community
Skip to main content
New Participant
April 16, 2024
Solved

Some svg images not working with file upload field

  • April 16, 2024
  • 1 reply
  • 1472 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by 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.

 

1 reply

Raja_Reddy
Raja_ReddyAccepted solution
New Participant
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.

 

New Participant
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