File download works on my local machine, but after I move to windows server 2003 and run from my development machine (XP) the file download returns error: Internet explorer cannot download Here is the code: FileStream MyFileStream = null; try { string sPath = ""; //sPath = HttpContext.Current.Server.MapPath(path); MyFileStream = new FileStream(path + @"\" + filename, FileMode.Open); long FileSize; FileSize = MyFileStream.Length; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.ClearHeaders(); byte[] Buffer = new byte[(int)FileSize]; MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length); // MyFileStream.Close(); string sDocType = ""; switch (ext) { case "doc": sDocType = "Application/vnd.ms-word"; break; case "pdf": sDocType = "application/pdf"; break; case "xls": sDocType = "application/vnd.ms-excel"; break; } HttpContext.Current.Response.ContentType = sDocType; HttpContext.Current.Response.AddHeader("Content-Length", FileSize.ToString()); HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + filename); HttpContext.Current.Response.Write(Buffer);