Azure Blob Storage Upload Error: (403) Forbidden

独自空忆成欢 提交于 2019-12-11 05:14:22

问题


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:

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)

Inner Exception:

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

SOURCE: System

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

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

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/14630150/azure-blob-storage-upload-error-403-forbidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!