Bluimp file upload send data to the server on .fileupload

Posted by MyName on Stack Overflow See other posts from Stack Overflow or by MyName
Published on 2012-12-05T15:57:25Z Indexed on 2012/12/05 17:04 UTC
Read the original article Hit count: 340

OK I've Googled...Googled and Googled again with no avail on how I can send data to the server like an ajax call's data option for the file upload:

$('#file_upload').fileupload({
            dataType: 'json',
            url: "@(Url.Action("UploadFiles", "ExcelUpload"))",
           // formData: function(form) { return [{ name: "dataTable", value : "@(Model)"}];},
            progressall: function (e, data) {  $(this).find('.progressbar').progressbar({ value: parseInt(data.loaded / data.total * 100, 10) });  },
            done: function (e, data) {
                BadFile(e, data); 
            }
        });

controller would look something like this:

[HttpPost]
        public ContentResult UploadFiles(Mytype param1, MyType Param2)
        { .. }

I want to do something similar to this:

$.ajax({
            url: "@(Url.Action("Action", "Controller"))",
            type: "post",
            data: { param1: value, param2: @(Model) }
        });

On the fileupload callback.

Is this possible? How can I pass values to the ServerSide? Should I switch to a different uploader..?

Please help me out! I need to resolve this as soon as possible.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about asp.net-mvc-3