I have a kendo upload component with a custom template that will include a dropdown list for each file selected. The user will select a list of files to upload and then use the dropdown lists to select the upload type for each item in the upload list.
I have 2 questions:
1. How do I get access to the dropdown values set for each item from inside my controller action?
2. if the upload fails how do I get error information to use in the onError method?
<script id=
"fileTemplate"
type=
"text/x-kendo-template"
>
<span class=
'k-progress'
></span>
<div class=
'file-wrapper'
>
<span class=
'file-icon #=addExtensionClass(files[0].extension)#'
></span>
<h4 class=
'file-heading file-name-heading'
>Name:
#=name#</h4>
<h4 class=
'file-heading file-size-heading'
>Size:
#=size# bytes</h4>
<label></label>
<select id=
"uploadType"
class=
"uploadType"
name=
"uploadType"
>
<option>Unknown</option>
<option>Type A</option>
<option>Type B</option>
<option>Type C</option>
<option>Type D</option>
</select>
<button type=
'button'
class=
'k-upload-action'
></button>
</div>
</script>
$(document).ready(
function
() {
$(
"#files"
).kendoUpload({
multiple:
true
,
async: {
saveUrl:
'@Url.Action("Save", "DataUpload")'
,
autoUpload:
false
},
template: kendo.template($(
"#fileTemplate"
).html()),
error: onError
});
});
function
onError(e)
{
???How
do
I get error information to use here???
}
[HttpPost]
public
ActionResult Save(IEnumerable<HttpPostedFileBase> files, ???)
{
//I need to know what type was selected before I can decide what
//processing should be done for the file. So, I assume I need another
//Param that contains he type selected by the user.
return
Content(
""
);
}
I have 2 questions:
1. How do I get access to the dropdown values set for each item from inside my controller action?
2. if the upload fails how do I get error information to use in the onError method?