采取下面方式下载时,文件名称长度最长为16个汉字,如果超长下载时会自动载取,请教该如何?????strFileName:下载的文件名称
strFilePath:下载的文件路径Response.AddHeader("Content-Disposition", "attachment; filename=" +
Server.UrlEncode(strFileName) );
Response.AddHeader("Content-Length",aFileInfo.Length.ToString());
Response.Charset = "UTF-8";
Response.ContentType    = "application/octet-stream";
//输出文件
Response.WriteFile(strFilePath);
Response.Flush();
Response.End();

解决方案 »

  1.   

    private void FileDownload(string FullFileName)
    {
    FileInfo DownloadFile = new FileInfo(FullFileName); 
    Response.Clear();
    Response.ClearHeaders();
    Response.Buffer=false;
    Response.ContentType="application/octet-stream";
    Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
    Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
    Response.WriteFile(DownloadFile.FullName);
    Response.Flush();
    Response.End();
    }
    我一直都用这个,你试试!