locked
Blob storage: SVG Content-Type RRS feed

  • Question

  • I have uploaded a blob with file extension svg.
    I would expect the content type to be "image/svg+xml" but instead I get "application/octet-stream".
    This causes that web applications cannot display these SVG files in img-tags.

    How can I manually configure blob storage to correctly set the content type?

    For Azure WebApps, there is the similar problem but here you can upload a web.config file to wwwroot/ folder wich solves this issue.

    EDIT: solution found

    When uploading blobs your client most probaply can set the content type.
    In my case that is the Ruby client: https://github.com/Azure/azure-storage-ruby/blob/master/lib/azure/storage/blob/block.rb

    create_block_blob has a parameter "options" that you can pass the content_type:
    • Edited by C_Mag_ Thursday, August 3, 2017 11:22 AM
    Thursday, August 3, 2017 10:11 AM

All replies

  • Thanks for sharing this information. It should certainly help those with a scenario like yours.

             

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, August 3, 2017 1:09 PM