逻辑应用程序HTTP保存到blob存储中,将保存为错误的内容类型
我正在使用逻辑应用程序将Excel文件从Outlook Inbox保存到BLOB存储中。这是我正在使用的代码。
"HTTP": {
"inputs": {
"authentication": {
"audience": "https://storage.azure.com",
"type": "ManagedServiceIdentity"
},
"body": "@items('For_each')?['ContentBytes']",
"headers": {
"x-ms-blob-type": "BlockBlob",
"x-ms-version": "2019-07-07"
},
"method": "PUT",
"uri": "blob storage path"
},
"type": "Http"
}
我的问题是该文件被保存为content-type“ application/ocket-stream”,而不是“ application/vnd.openxmlformats officecument.spreadsheetml.sheet”。有什么方法可以更改内容类型?
I am using a Logic App to save excel files from an Outlook inbox into a Blob Storage. This is the code I am using.
"HTTP": {
"inputs": {
"authentication": {
"audience": "https://storage.azure.com",
"type": "ManagedServiceIdentity"
},
"body": "@items('For_each')?['ContentBytes']",
"headers": {
"x-ms-blob-type": "BlockBlob",
"x-ms-version": "2019-07-07"
},
"method": "PUT",
"uri": "blob storage path"
},
"type": "Http"
}
My issue is that the file is being saved as Content-Type "application/octet-stream", instead of "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet". Is there a way I can change the Content-Type?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您的要求,您可以使用
创建blob(v2)
直接将Outlook的Excel文件附件保存到Blob存储中。As per your requirement, you can use
Create blob (V2)
to directly save the outlook's excel file attachment to blob storage.如果您使用的是HTTP终点,则应该能够根据文档在标题中指定内容类型。
https://learn.microsoft.com/en-en-en-en-us/en-en-us/ REST/API/Storageservices/put-blob
如果那不起作用,请尝试列出的另一个,实际上看起来像是正确使用的一个... x-ms -blob-content-type
If you're using the HTTP end point then you should be able to specify the content type in the header, as per the documentation.
https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob
If that doesn’t work, try the other one listed which actually looks like the right one to use ... x-ms-blob-content-type