如何使用HTTP上传文件“ PUT”使用JQuery?

我想使用JQuery-File-Upload上传文件,但使用HTTP“PUT”而不是multipart-forms。根据他们的网站:
- Multipart and file contents stream uploads:
    Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
但我在他们的文档中找不到如何做到这一点。有人可以帮忙吗?     
已邀请:
根据:https://github.com/blueimp/jQuery-File-Upload/wiki/Options   方法      用于HTTP请求的方法   将文件发送到服务器。可   POST(multipart / formdata文件上传)   或PUT(流式文件上传)。   接受字符串或函数   返回一个字符串。 你应该使用:
$('#file_upload').fileUpload({
    namespace: 'file_upload_1',
    url: '/path/to/upload/handler.json',
    method: 'PUT'
});
    
我也喜欢REST,但您可能希望确保在需要支持的浏览器上进行单元测试。 http://api.jquery.com/jQuery.ajax/ 要求的类型(“POST”或“GET”),默认为“GET”。注意:此处也可以使用其他HTTP请求方法,例如PUT和DELETE,但旧版浏览器可能不支持这些方法。 看到这个答案 如何使用JQuery将数据输出到Rails     

要回复问题请先登录注册