I have been using some code to download various MIME types such as MP3s (see below) but I can't get it working for Zip files. Here is my code, can anybody tell me where I am going wrong, I have tried both with the commented line and without and both times I get a 'file not found' type error :
[Authorize]
public virtual FileResult DownloadZip(string fileName)
{
var downloadPath = Server.MapPath("~/Content/Downloads/");
//fileName = Path.ChangeExtension(Path.GetFileName(fileName), "zip");
var file = Path.Combine(downloadPath, fileName);
return File(file, "application/zip", fileName);
}
EDIT : It seems like the Zip files are being changed to Rar files because WinRar is installed on the server, is there anything I can do about this apart from uninstalling WinRar?