ASP.NET MVC returning zipped file with FileResult is missing extension
Asked Answered
C

1

6

I have a zipped file which I am trying to stream to client:

public FileResult GetFiles()
{
    return File("test.zip", "application/zip");
}

The file downloads but without the ".zip" extension.

Culinarian answered 8/11, 2010 at 16:32 Comment(0)
E
13

You could specify a download filename:

return File("test.zip", "application/zip", "test.zip");
Exchange answered 8/11, 2010 at 20:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.