Downloading excel file - Norwegian characters are replaced with underscore

Viewed 37

Trying to download an excel file from a .NET Core API.

var filename = doc.Name + Path.GetExtension(filePath);
// filename would be Name øæäåöõ.xlsx
var contentType = doc.ContentType;
return File(stream, contentType, filename, modifiedTime, null);

But the file is downloaded as Name ______.xlsx. The special characters are missing! Tried adding Content-Disposition from this post, but that didn't work either.

What am I missing here?

My response headers from Chrome:

enter image description here

0 Answers
Related