I have an action that returns mp3 file as below :
var memory = new MemoryStream(); using (var stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) { await stream.CopyToAsync(memory); } memory.Position = 0; //Response.Headers.Add("Accept-Ranges", "bytes"); //Response.Headers.Add("Connection", "keep-alive"); return File(memory, "audio/mpeg", $"music.mp3", true);
So the is partial content. After 10 minutes of playing the mp3 file by calling my action, the player stops. I saw that html default player has logged following error in the browser console :
" net::ERR_CONNECTION_RESET 206 (Partial Content)"
What would be the reason ?