【问题标题】:fine-uploader azure originator in request instead of endpoint请求中的精细上传者 azure originator 而不是端点
【发布时间】:2017-04-27 15:21:11
【问题描述】:

我正在尝试将 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, },

在调试模式下,我看到 Fine-uploader azure 正确获取了 sas,然后尝试发送 put 请求,但它没有按照输入的方式转到 azure 端点,而是尝试根据此消息将其发送到主机。
请求网址:https://myhostsite/project/sr=c&sp=w&sig=Vh/QLKT3xhkbGBsiUAk4U1eEFpAcD87OK9%2BqgGd8cO4%3D&sv=2016-05-31&se=2017-04-26T22%3A34%3A57Z 请求方法:PUT 状态码:405 方法不允许

【问题讨论】:

    标签: javascript azure fine-uploader


    【解决方案1】:

    在您设置 CORS 规则时,您是否在 AllowedMethods 中允许 PUT 请求?

    我将您的代码与Fine Uploader 5.14.2 一起用于将图像文件上传到 Azure 存储。它在我的网站上运行良好。

    这是来自 SO 的类似问题:Azure CORS Configuration

    【讨论】:

    • 感谢您的回复并抽出宝贵时间。我很尴尬地说我误解了精细上传文档,并且在 SAS 返回时我只包括了 SAS 而不是完整的 SAS_URL。这导致 put 请求转到主机而不是我的天蓝色存储。现在效果很好。
    猜你喜欢
    • 2016-03-06
    • 1970-01-01
    • 2015-05-30
    • 2021-01-19
    • 1970-01-01
    • 2022-09-23
    • 2022-11-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多