请检查一下file.Name请参考
Response.AddHeader("Content-Disposition", "attachment;FileName=" + 
System.Web.HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes( ds.Tables[0].Rows[0]["FileName"].ToString() )));
Response.Charset ="UTF-8";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.ContentType = ds.Tables[0].Rows[0]["ContentType"].ToString();
Response.BinaryWrite((Byte[])ds.Tables[0].Rows[0]["Content"]);
Response.Flush();

解决方案 »

  1.   

    Response.AppendHeader("content-disposition", "attachment; filename="  + 
    System.IO.Path.GetFileName(ds.Tables[0].Rows[0]["FileUrl"].ToString()));
    Response.WriteFile(ds.Tables[0].Rows[0]["FileUrl"].ToString());
    Response.End();
      

  2.   

    我在asp中作过文件的下载,使用的方法和搂主的相同!
    我用的是Response.BinaryWrite!
    我也出现过下载的是页面文件asp,原因是ie(或者说windows系统)不能识别下载的文件类型!
    我解决的办法:正确设置Response.ContentType,安装能够识别下载文件的软件!
    如要下在word文件就要求安装word!
      

  3.   

    打开 我的电脑--》工具--》文件夹选项--》文件类型--》选中 CSV 文件  点下面的高级选项 把里面的 下载后确认打开 选中   估计就可以了
      

  4.   

    如果是下载csv,Response.ContentType应该设置成什么呢?楼上的方法不行
      

  5.   

    CSV是Microsoft逗号分隔值文件!
    csv(comma separated values)文件实际上是这样一种纯文本文件:它的数据项(对应于表格的列)之间用逗号隔开,各条记录(对应于表格的行)之间用“换行”和“回车”隔开。它可以被任何文本编辑器调用,如记事本、写字板以及dos的edit等,在windows操作系统中安装ms office后,csv文件的默认打开方式是ms excel!所以Response.ContentType="application/vnd.ms-excel"!!!!问题应该解决了!!!
      

  6.   

    搂主应该结贴了吧!我查了好一会才弄明白csv是什么?