You are uploading and adding a single record. If you upload multiple files, you overwrite the file data on that record with each item in the list, leaving just the last file.
You need to add a record for each file in the list.
Also, most of your model properties don't seem to be intended to be editable by the user, so it doesn't make sense to use that model for your view.
public async Task<IActionResult> Create(List<IFormFile> Data)
{
if (!ModelState.IsValid)
{
return View();
}
foreach (var item in Data)
{
if (item.Length == 0) continue;
using var ms = new MemoryStream();
await item.CopyToAsync(ms);
_context.AddAsync(new tblFile
{
Name = Path.GetFileName(item.FileName),
ContentType = item.ContentType,
Data = ms.ToArray(),
CreatedOn = DateTime.UtcNow,
});
}
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));
}