请问从ASP画面生成CSV文件时,怎样设置路径能下载到本地,而不是服务器端。

解决方案 »

  1.   

    Response.Clear()
            Response.ContentType = "Application/octet-stream"
            Response.ContentEncoding = System.Text.Encoding.UTF8
            Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(Right(file.Name, file.Name.Length - 8)))
            Response.AddHeader("Content-Length", file.Length.ToString())
            Response.WriteFile(file.FullName)
            Response.End()