Search code examples
.net-corecontent-disposition

getting filename attribute twice in content-disposition


I am returning a file from my dotnet core api-controller like below

return File(csvData, "text/csv", "file.csv");

and in the browser response, what I get is

Content-Disposition: attachment; filename=file.csv; filename*=UTF-8''file.csv

Why is the filename attribute coming twice?


Solution

  • These are two attributes, "filename" and "filename*".

    See https://greenbytes.de/tech/webdav/rfc6266.html.