在请求中而不是在端点上的精细上载azure始发者 [英] fine-uploader azure originator in request instead of endpoint
问题描述
我正在尝试将blob放入天蓝色的存储中,我相信我已经正确设置了服务器端的sas和天蓝色的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,
},
I am attempting to put blobs to azure storage and I believe I have the server side sas and azure CORS set up correctly.
In my html I have
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,
},
在调试模式下,我看到fine-uploader azure正确地获取了sas,然后尝试发送放置请求,但没有按照输入的内容转到azure端点,而是尝试根据此消息将其发送到主机. > 请求网址:
In debug mode I see fine-uploader azure gets the sas correctly and then attempts to send the put request but instead of going to the azure endpoint as entered, it attempts to send it to the host as per this message.
Request URL:https://myhostsite/project/sr=c&sp=w&sig=Vh/QLKT3xhkbGBsiUAk4U1eEFpAcD87OK9%2BqgGd8cO4%3D&sv=2016-05-31&se=2017-04-26T22%3A34%3A57Z
Request Method:PUT
Status Code:405 Method Not Allowed
推荐答案
在设置 CORS 规则时,您是否已允许 AllowedMethods 中的PUT请求?
Have you permitted PUT request in AllowedMethods while you set CORS rules?
我将您的代码与Fine Uploader 5.14.2
一起使用,以将图像文件上传到Azure存储.它在我的网站上工作正常.
I took your code with Fine Uploader 5.14.2
to upload an image file to Azure storage. It works fine on my site.
这是来自SO的类似问题: Azure CORS配置
And here is a similar question from SO: Azure CORS Configuration
这篇关于在请求中而不是在端点上的精细上载azure始发者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!