Downloading a csv file fails with Multiple_Content_Disposition

I have a web-based file upload/download mechanism using ServiceStack (5.11.0). The backend is running on Windows/IIS(Express).

It works for different file types (e.g. txt, pdf, xslx, docx, jpg, etc.), however trying to download a .csv file fails with a browser (Chrome/Edge) error:


I have no errors recorded in my log files and no backend exceptions thrown when debugging in Rider.

The essence of my download service is:

[Route("/filestore/file/{FileName}", "GET")]
public class GetFile : IReturn<HttpResult>, IGet
    public string FileName { get; init; }


public object Get(GetFile request)
    var fsroot = @"C"\temp";
    var path = Path.Combine(fsroot, request.FileName);

    var file = VirtualFiles.GetFile(path);
    var mime = MimeTypes.GetMimeType(file.Extension);

    var response = new HttpResult(file, mime, asAttachment: true);
    return response;

Anybody know why csv files do not download?

Can you post the raw HTTP Request and Response Headers.

I’m assuming the issue is the built-in CsvFormat is also adding Content-Disposition headers which duplicates them, it should be resolved from this commit where if you’re returning a HttpResult it’s assumed you’re taking over the custom HTTP Response Headers.

This change is available from v5.11.1 that’s now available on MyGet.

5.11.1 solves the problem.

Perfect support, license is worth every penny.

Thank you.

1 Like