For some reason, my uploading file/image code escapes me - I can't remember for the life of me on how to get it to work.
Code:
if (model.ImageUpload != null) { var filePath = Path.Combine(_hostingEnvironment.WebRootPath,"images/series" + model.ImageUpload.FileName); await model.ImageUpload.CopyToAsync(new FileStream(filePath, FileMode.Create)); series.ImagePath = model.ImageUpload.FileName; }
--ImageUpload is an IFormFile in my model class.
When saving the record, I get the above error...