Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

NotSupportedException: The given path's format is not supported

$
0
0

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...


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>