Unplanned
Last Updated: 28 Jul 2021 16:11 by Sripathi
Sripathi
Created on: 28 Jul 2021 16:11
Category: Spreadsheet
Type: Bug Report
0
Telerik.Web.Spreadsheet Workbook Save method throws an exception in Docker container

Bug report

Reported in Ticket ID: 1529288

Reproduction of the problem

Create an MVC application:

View:

@{
	ViewBag.Title = "Home Page";
	string sfile = System.IO.Path.Combine(Server.MapPath("~"), "File1.xlsx");
}

@Html.Kendo().Spreadsheet().Name("spreadsheet"))

<br />	
<br />	
<button class="k-button k-primary" id="export" onclick="ExportExcel()">Export Spreadsheet content</button>
<script>
    function ExportExcel() {
        var spread = $('#spreadsheet').getKendoSpreadsheet();
        var data = JSON.stringify(spread.toJSON());

        var fd = new FormData();
        fd.append('wbook', data);
        fd.append('sfile', "File1.xlsx");

        $.ajax({
            url: "@Url.Action("SaveFileExcel", "Home")",
            data: fd,
            contentType: "application/x-www-form-urlencoded",
            processData: false,
            contentType: false,
            type: "POST",
            statusCode: {
                200: function (xhr, status, err) {
                    console.log('File exported!');
                },
                500: function (xhr, status, err) {
                    console.log('Internal Server Error!');
                }
            }
        });
    }
</script>

Controller:

[HttpPost]
public ActionResult SaveFileExcel(string wbook, string sFile)
{
    var workbook = Telerik.Web.Spreadsheet.Workbook.FromJson(wbook);
    string physicalPath = Path.Combine(Server.MapPath("~/"), sFile);
    //workbook.Save("C:/inetpub/wwwroot/" + sFile
    workbook.Save(physicalPath);
    return new EmptyResult();
}
  1. Add the application to a Docker container.
  2. Place a breakpoint in the SaveFileExcel action.
  3. Run the app and click the button below the Spreadsheet.

Current behavior

The Save method throws System.ExecutionEngineException

Expected/desired behavior

The file is saved.

Environment

  • Kendo UI version: 2021.2.616
  • jQuery version: x.y
  • Browser: [all]
0 comments