且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python Azure上载的文件内容类型已更改为application/octet-stream

更新时间:2023-10-17 18:07:40

您可以像这样显式设置content-type属性:

You can explicitly set the content-type property like this:

from azure.storage.blob import ContentSettings

block_blob_service.create_blob_from_path(
    'mycontainer',
    'myblockblob',
    'mypngimage.png',
    content_settings=ContentSettings(content_type='image/png')
)

来源: https://docs.microsoft.com/zh-CN/azure/storage/blobs/storage-python-how-to-use-blob-storage