文件存在文件服务器上,路径假设为http://www.abc.com/D904F5FE-918C-4D72-9049-FA275976658A.XLS
现在我希望点击下载的时候(通过WEB站点,跟文件服务器不在同一台机),下载保存的文件名为"XXX.XLS"。如何实现?求教

解决方案 »

  1.   

    呃?这个?很简单啊?FileInfo aFile = new FileInfo(dt.Rows[0]["fj_guid_name"].ToString());
                Response.Clear();
                Response.ContentType = "application/octet-stream";
                string path2 = Server.MapPath(服务器显示名);
                           Response.AddHeader("Content-Disposition", "attachment;FileName=" + System.IO.Path.GetFileName(原名);            Response.WriteFile(path2);
                Response.End();
    这是平常下载的,只是在同一服务器,
    你稍微修改下