Azure Blob存储上载错误:(403)禁止 [英] Azure Blob Storage Upload Error: (403) Forbidden

查看:351
本文介绍了Azure Blob存储上载错误:(403)禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建了一个新的过程来将文件上传到我们的Azure blob.在本地运行应用程序时,文件上传正常且没有错误.当我们在服务器上运行相同的进程时,会收到错误消息:

We have created a new process to upload files to our Azure blob. When running the app locally, the files upload fine and without error. When we run the same process on our server, we get the error message:

消息:禁止:标头"Content-Type"值被拒绝SOURCE: Microsoft.WindowsAzure.StorageClient目标:T get_Result() 堆栈跟踪: Microsoft.WindowsAzure.StorageClient.Tasks.Task 1.get_Result() at Microsoft.WindowsAzure.StorageClient.Tasks.Task 1.ExecuteAndWait()在 Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImpl(Func`1 展示) Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream 源,BlobRequestOptions选项)位于 Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream 来源)

MESSAGE: Forbidden: header 'Content-Type' value denied SOURCE: Microsoft.WindowsAzure.StorageClient TARGETSITE: T get_Result() STACKTRACE: at Microsoft.WindowsAzure.StorageClient.Tasks.Task1.get_Result() at Microsoft.WindowsAzure.StorageClient.Tasks.Task1.ExecuteAndWait() at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImpl(Func`1 impl) at Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream source, BlobRequestOptions options) at Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream source)

内部异常:

消息:远程服务器返回错误:(403)禁止.

MESSAGE: The remote server returned an error: (403) Forbidden.

来源:系统

目标:System.Net.WebResponse EndGetResponse(System.IAsyncResult)

TARGETSITE: System.Net.WebResponse EndGetResponse(System.IAsyncResult)

堆栈跟踪:位于System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

STACKTRACE: at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

在 Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req,IAsyncResult asyncResult,EventHandler`1处理程序,对象发送者)

at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)

奇怪的是文件仍上传到Azure.有人经历过吗?上载文件时,我们不会设置内容类型,就像下载文件时设置内容类型一样.我们尝试对其中的一个进行硬编码,但仍然会产生相同的错误.

What is odd is that the file uploads still to Azure. Has anyone experienced this? We don't set a content type when we upload the file, as we set it when the file is downloaded. We tried hardcoding one in, and it still produced the same error.

推荐答案

原来是Firefox问题.我们必须修改代理以不允许任何内容类型从Azure返回给我们.似乎文件已被上传,但是Azure希望响应我们对它的调用,而我们的防火墙阻止了响应.理想情况下,Azure将通过在响应中包括内容类型来解决此问题,因此我们不需要进行此类防火墙更改.

It turned out to be a Firefox issue. We had to modify the proxy to allow no content type to come back to us from Azure. It seems that the files were being uploaded, but Azure wanted to respond to our call to it, and our firewall was blocking the response. Ideally, Azure would fix the issue by including a content type in their response, so we don't need to make firewall changes such as this.

这篇关于Azure Blob存储上载错误:(403)禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆