开发者

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 t开发者_Go百科he ".zip" extension.


You could specify a download filename:

return File("test.zip", "application/zip", "test.zip");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜