Good morning,
Thank you for your prompt replies in this thread BUT your sample does NOT work on MacOS, Safari 16.1 (17614.2.9.1.13, 17614). Your sample is using Syncfusion.EJ2.AspNet.Core version 20.3.0.61 and still, when run, the collection of files posted to the controller is null.
Here is the controller code:
[HttpPost]
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:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=webapp1
StackTrace:
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,