webAPI 控制器中的 ng-flow 访问参数

ng-flow access parameters in webAPI controller

我正在使用 ng-flow 将图像上传到我的 webAPI,如下所示:

                <div class="form-horizontal" role="form" flow-init="config"
                     flow-file-added="!!{png:1,gif:1,jpg:1,jpeg:1}[$file.getExtension()]"
                     flow-files-submitted="$flow.upload()">
                    <img flow-img="$flow.files[0]" style="max-width:150px; max-height:150px;" />
                    <span class="btn btn-success" flow-btn flow-attrs="{accept:'image/*'}">Upload Image</span>
                </div>

$scope.config = {
        query: function (flowFile, flowChunk) {
            // function will be called for every request
            return {
                id: 2, source: 'flow_query'
            };
        }
    };

问题是如何访问 api 控制器中的 'id' 参数,我尝试访问 Content-D。没有运气:

        string root = HttpContext.Current.Server.MapPath("~/Content/Images/User");
        var provider = new MultipartFormDataStreamProvider(root);

        try
        {
            // Read the form data.
            await Request.Content.ReadAsMultipartAsync(provider);

            // This illustrates how to get the file names.
            foreach (MultipartFileData file in provider.FileData)
            {
                //Console.WriteLine(file.Headers.ContentDisposition.FileName);
                //Trace.WriteLine("Server file path: " + file.LocalFileName);
                var PId = file.Headers.ContentDisposition.Parameters.First(x => x.Name.Contains("id"));

这花了太长时间:

var provider = new MultipartFormDataStreamProvider(root);
var x = provider.FormData["id"];