We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Uploader posts null collection of files on MacOS, Safari even with Syncfusion version - Provided sample does not work

Good morning,

Thank you for your prompt replies in this thread BUT your sample does NOT work on MacOS, Safari 16.1 (17614., 17614). Your sample is using Syncfusion.EJ2.AspNet.Core version and still, when run, the collection of files posted to the controller is null.

Here is the controller code:

public async Task Index(UpdateTestViewModel model)
    string uploadsFolder = Path.Combine(hostingEnv.WebRootPath, @$"Content\Tests\Images");
    foreach (var fileToUpload in model.Images)
        string filePath = Path.Combine(uploadsFolder, fileToUpload.FileName);
        using (FileStream fs = System.IO.File.Create(filePath))
            await fileToUpload.CopyToAsync(fs);
    return View(model);

The above code works fine on Windows (Chrome browser). But on Safari, the error is:

Message=Object reference not set to an instance of an object.
at webapp1.Controllers.HomeController.d__4.MoveNext() in HomeController.cs:line 36

Line 36 is:  

foreach (var fileToUpload in model.Images)

model.Images is null.

Any ideas?

Thank you very much in advance,

1 Reply 1 reply marked as answer

UD UdhayaKumar Duraisamy Syncfusion Team December 27, 2022 01:41 PM UTC

Dimitris, after validating the requirement on the latest updated sample, the sample has old version scripts. After updating the latest version scripts in the _Layout.cshtml page the reported issue does not occur.

Find the screenshot here:

Find the latest updated sample in the attachment:

Find the latest updated scripts in _Layout.cshtml:

<link rel="stylesheet" rel='nofollow' rel='nofollow' href="https://cdn.syncfusion.com/ej2/20.4.38/fabric.css"

          asp-fallback-rel='nofollow' rel='nofollow' href="~/css/ej2/fabric.css"




          asp-suppress-fallback-integrity="true" />


    <script src="https://cdn.syncfusion.com/ej2/20.4.38/dist/ej2.min.js"




Sample : https://www.syncfusion.com/downloads/support/forum/179489/ze/webapp1_cedc209d

Marked as answer
Live Chat Icon For mobile
Up arrow icon