开发者

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

开发者 https://www.devze.com 2023-01-24 04:52 出处:网络
I have a zipped file which I am trying to stream to client: public FileResult GetFiles() { return File(\"test.zip\", \"application/zip\");

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

精彩评论

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