精细上传器从MVC端点获取params

时间:2016-11-06 17:23:43

标签: azure fine-uploader

我尝试设置精细的上传器参数,如下所示

callbacks: {
        onUpload: function (id, name) {
            var params = {fileSize: uploader.getSize(id), fileName: name };
            uploader.setUploadSuccessParams(params, id); // Work
            uploader.setParams({ newPar: "321" });  // Doesn't work

        },
    } 

我可以从成功终点获得成功参数,如下所示

        [HttpPost]
        [Route("success")] //Succes endpoint
        public async Task OnUploadSuccess()
        {
            var fileName = Request.Form.Get("fileName");
            var fileSize = long.Parse(Request.Form.Get("fileSize"));
        }

但是对于params

也不能这样做
   [HttpGet]
    [Route("sas")] //Request endpoint
    public ContentResult CreateSas()
    {
        var param= Request.Form.Get("newPar"); //Doesn't work
    }

有关如何在MVC控制器中获取此参数的任何帮助

1 个答案:

答案 0 :(得分:0)

setParams将参数作为标头发送到Azure,附加到“PUT BLOB”请求。您无法将自定义参数发送到SAS端点。 https://github.com/FineUploader/fine-uploader/issues/1224