I'm trying to record an audio-file using MediaRecorder and upload the recorded audio to the server's disk afterwards. Recording is no problem so far and I have the BLOB available. All I want to do, is to attach the file to a form, so I can access it in my controller, when the submit button gets clicked.
My JavaScript-Function looks like this:
function sendData(data) {
var fd = new FormData(document.forms["form1"]);
fd.append("AudioFile", data, URL.createObjectURL(data));
Unfortunately it's not available in my controller:
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> NewTerm(NewTermViewModel model)
{
var files = HttpContext.Request.Form.Files;
What do I have to do to access the file in my controller?