Question Kendo File Upload in server Side code sample

I have approved this post but it needs significant improvement. Firstly, you have indicated that this is a question but you have posted in a forum that is not generally for questions. The Web Resources forum is for sharing existing resources with others who may find them useful, not for asking questions. Apart from that, you haven't even asked a question. If you're actually asking for others to provide you with a code example then you might consider using the word "please" and actually asking a question, e.g.
Could someone please provide a code example of X?
Furthermore, just asking for others to provide code examples is a bit much. Please provide a FULL and CLEAR explanation of the problem. What have you done and where are you stuck? Do you really have no idea how to perform this file upload and are unable to find anything on the subject with a web search? If you have done anything at all, explain it and show us the relevant code and any relevant error messages.
 
i need to convert the excel file content as datatable using the kendo upload.
my issue is not set the breakpoint in server call.
I have attached my source file with video reference.
thank you for supporting us
 

Attachments

  • FileUploadAspxcs.txt
    726 bytes · Views: 62
  • FileUploadAspx.txt
    1.9 KB · Views: 54
  • FileUpload Video Ref.mp4
    1.4 MB
Please post your code on the forum formatted and wrapped in code tags.
You should also post only the relevant problematic code and explain the problem with it.

Thanks
 
var ALLOWED_EXTENSIONS = [".xlsx", ".csv", ".txt", ".json"];
$("#upload").kendoUpload({
async: {
saveUrl: "BOQImport.aspx/uploadFile"
},
multiple: false,
localization: {
"select": "Select file to import..."
},
select: function (e) {
var extension = e.files[0].extension.toLowerCase();
if (ALLOWED_EXTENSIONS.indexOf(extension) == -1) {
alert("Please, select a supported file format");
e.preventDefault();
}
},
success: function (e) {
// Load the converted document into the spreadsheet
spreadsheet.fromJSON(e.response);
},
error: function (e) {
console.log(e);

},
})
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Mvc;
using System.IO;
using Telerik.Web.Spreadsheet;

namespace POCSource
{
public partial class BOQ_Import : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
// GET: Default
[HttpPost]
public ActionResult Upload(HttpPostedFileBase file)
{
var workbook = Workbook.Load(file.InputStream, Path.GetExtension(file.FileName));
return Content(workbook.ToJson(), Telerik.Web.Spreadsheet.MimeTypes.JSON);
}
}

}
 
Which part of that is formatted and wrapped in code tags?

You also failed to explain the problem with the code as asked already...
 
Back
Top Bottom