after days of googling and trying i am not able to have xsd-files uploaded to the webserver.
Here you see the create form:
<form asp-action="Create" enctype="multipart/form-data" method="post">
<input asp-for="catname" class="form-control" />
<input type="file" asp-for="xsddata" class="form-control" />
<input type="submit" value="Create" class="btn btn-primary" />
</form>
The model looks like this:
public class cat{
[Key]
public int catid { get; set; }
public string catname { get; set; }
public string xsddata { get; set; }}
and I only want to save the path & filename in the database.
Within the controller-class I have added the method for saving:
[HttpPost]
public async Task<IActionResult> Upload([FromForm]IFormFile file)
{
var path = Startup.myAppPath();
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
FileInfo fileInfo = new FileInfo(file.FileName);
var fullPath = Path.Combine(path, fileInfo.Name);
if (!System.IO.File.Exists(fullPath))
{
using (FileStream fileStream = new FileStream(fullPath, FileMode.Create))
{
await file.CopyToAsync(fileStream);
}
return new JsonResult(new { FileName = fileInfo.Name });
}
return BadRequest();
}
But right now, the IDE crashes even after I have choosen a file and before I hit the 'submit' button.
This drives me crazy for days, and I cannot find an example to rely on. Would be nice if you guys might help me out.

