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.