【发布时间】:2021-12-27 20:43:57
【问题描述】:
我在 plotly 中创建了一个 html,并希望将其上传到 azure blob 存储。
fig.write_html("C:/test.html")
如何写在内存中,以便上传?
使用时
html_file = io.StringIO()
fig.write_html(html_file)
上传时出现错误,不是字节。
正常上传我使用的html字符串时
blob_client.upload_blob(html.encode('utf-8') ,blob_type="BlockBlob", overwrite=True, content_settings=ContentSettings(content_type='text/html'))
有什么建议吗?
编辑:
我需要将它写入内存,因为我在天蓝色函数中使用它。
【问题讨论】:
标签: python azure-functions plotly azure-blob-storage