1

i create a simple mvc3(razor) web application and want to use it "for my customers to download files from my site". it works fine on local host but when i upload it on my host when user press download button the browse dialog box come up to download it can not realize file tipe and say unknown file and remove file extension for example : "test.rar" will convert to "test" with no file extension. i tested it on Firefox 12 and ie8 they show one behavior. please help me my code:

  public ActionResult down(string id)
        {

        return File(@"c:\test.rar", "rar", "test.rar");
    }
4

1 回答 1

2

Try to change content type to application/x-rar-compressed or application/octet-stream.

于 2012-07-09T05:14:02.397 回答