This is a migrated thread and some comments may be shown as answers.

Uploaded file not passes to Action (controller)

2 Answers 122 Views
This is a migrated thread and some comments may be shown as answers.
Silver Lightning
Top achievements
Rank 1
Silver Lightning asked on 02 Jun 2014, 11:47 PM

Hi Sir

I used async upload, on my view I used the event select and upload function. the problem is the request not sent to the Action once I uploaded a file.

Here's my code snippet.

 $(document).ready(function () {

var lookup = $("#ComboLookupTable").data("kendoComboBox");
$("#get").click(function () {

async: {
saveUrl: "UploadFile/Lookup",
removeUrl: "remove",
autoUpload: false,
value: 'Import'
multiple: false,
progress: function (e) {

upload: function (e) {
// debugger;
var kendoWindow = $("<div />").kendoWindow({
title: "Replace Lookup Table Data?",
resizable: false,
modal: true

.click(function () {
if ($(this).hasClass("delete-cancel")) {

else { = { additional: $("#ComboLookupTable").val() };

// ---------

// = { additional: $("#ComboLookupTable").val() };
select: function (e) {
// debugger; = { additional: $("#ComboLookupTable").val() };
localization: {
select: "Select a file",
uploadSelectedFiles: "Import",
remove: "Remove"
//upload: onUpload
//select: onSelect


Here's my controller (action)

'Upload File (excel)
<HttpPost> _
Public Function UploadFile(ByVal files As HttpPostedFileBase, ByVal additional As String) As ActionResult

Dim data = (New ExcelReader()).ReadExcel(files)

Select Case additional
Case FuelEfficiencyViewModel.Table.Lookup.ConversionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.ElectricalRegionalEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.ElectricalSubRegionEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.FuelEfficiecies
Dim ent As New List(Of ViewModel.FuelEfficiencyViewModel.Create)

For Each datarow In data.DataRows
ent.Add(New ViewModel.FuelEfficiencyViewModel.Create With {.VehicleClass = datarow(0).ToString, _
.FuelEfficiencyValue = Convert.ToDecimal(datarow(1)), _
.CreatedBy = Session(LocalConstant.Ses_UserID), _
.CreatedDate = Now.Date})
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.GlobalEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.GlobalWarmingPotential
Return View()

End Select

'Session(LocalConstant.SessionExcelData) = resultList

Return View("Index", data.Status)
'Return View()
End Function

Thank you in advance and God bless.

2 Answers, 1 is accepted

Sort by
Silver Lightning
Top achievements
Rank 1
answered on 03 Jun 2014, 06:10 AM
I solved it. Thanks
Dimiter Madjarov
Telerik team
answered on 03 Jun 2014, 08:24 AM
Hello Jesureno,

Nice to hear the problem is solved. Let us know if you experience any further issues.

Have a great day!

Dimiter Madjarov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Silver Lightning
Top achievements
Rank 1
Answers by
Silver Lightning
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question