Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 658
fearofawhackplanet Avatar asked Nov 08 '10 16:11

fearofawhackplanet


1 Answers

You could specify a download filename:

return File("test.zip", "application/zip", "test.zip");
like image 126
Darin Dimitrov Avatar answered Sep 30 '22 18:09

Darin Dimitrov