2017-04-26 28 views
0

我试图把blob到azure存储,我相信我有服务器端sas和azure CORS正确设置。 在我的HTML我有 var uploader = new qq.azure.FineUploader({ element: document.getElementById('fine-uploader'), debug: true, request: { endpoint: 'https://mystorage.blob.core.windows.net/mycontainer' }, signature: { endpoint: 'https://myserver/sas/' }, uploadSuccess: { endpoint: '/success' }, retry: { enableAuto: true }, deleteFile: { enabled: true }, cors: { expected: true, sendCredentials: true, },罚款上传azure始发者在请求而不是端点

在调试模式下我看到细密的上传蔚蓝正确获取SAS,然后尝试为进入发送PUT请求,但而不是去湛蓝的端点,它试图将其发送到主机按照此消息。
请求URL:https://myhostsite/project/sr=c&sp=w&sig=Vh/QLKT3xhkbGBsiUAk4U1eEFpAcD87OK9%2BqgGd8cO4%3D&sv=2016-05-31&se=2017-04-26T22%3A34%3A57Z 请求方法:PUT 状态代码:405不允许的方法

回答

0

您许可PUT请求AllowedMethods,而你设置CORS规则?

enter image description here

我把你的代码Fine Uploader 5.14.2上传图像文件到Azure存储。它在我的网站上正常工作。

enter image description here

这里是一个类似的问题,从SO:Azure CORS Configuration

+1

谢谢你的反应和服用时间。我很尴尬地说,我误解了优秀的上传器文档,并且在SAS回报中,我只包含SAS而不是完整的SAS_URL。这导致放入请求转到主机而不是我的天蓝色存储。现在效果很好。 – Jeff