When I upload the image, I got an error 'Only files with mime type image/svg+xml are allowed. Mime type deletected text/html'. Let me know how to fix this

Comments

Vijeth N created an issue. See original summary.

cilefen’s picture

Title: Issue on Uploading SVG image » Only files with mime type image/svg+xml are allowed. Mime type detected text/html
Assigned: Vijeth N » Unassigned
Category: Bug report » Support request
Issue tags: -SVG image upload issue

I do not believe you intentionally assigned yourself. Perhaps this article may help.

jwilson3’s picture

@Vijeth if you're optimizing your SVGs with svgo or other web-based tools, they often strips the <?xml version="1.0" encoding="UTF-8"?> from the first line, which sometimes is used to detect the mime type. Maybe try the upload with that line, and confirm if it works or not.

I agree that this is not an optimal solution to have to add back this xml code to all images before uploading.

jwilson3’s picture

Issue tags: +svg
jwilson3’s picture

Issue tags: +mime types

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
cilefen’s picture

Status: Active » Closed (outdated)
Issue tags: -svg, -mime types

I am closing this support request because there have been no recent comments.

The Drupal Core issue queue is not the ideal place for support requests. Consider other sources of support.