I have a problem when trying to download a file from server to client. On click the save file prompt is shown like its supposed to be, but it doesnt point to the file I want to download, but rather to my aspx page? In other words, it doesnt download the file i wish to download, but it downloads the page upon which the download link is located. Really weird... It seems almost as if the file i specify for download is being completely ignored/has no effect...
if (File.Exists(Server.MapPath(driversLocation + name + ".zip")))
{
FileInfo fileInfo = new FileInfo(Server.MapPath(driversLocation) + name + ".zip");
Response.Clear();
Response.AddHeader("Content-Disposition", "inline;attachment; filename=" + name + ".zip");
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.ContentType = "application/download";
Response.Flush();
Response.TransmitFile(Server.MapPath(driversLocation) + name + ".zip");
Response.End();
}
Any help would be appreciated!