protected void getFileAttachment(byte[] bytes)
{
Response.Clear();
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = fileType;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + "test101");
Response.OutputStream.Write(bytes,0,bytes.Length);
Response.BinaryWrite(bytes);
Response.Flush();
}
我正在尝试转换保存在SQL Server中的varbinary,但由于输出文件没有扩展名,我遇到了麻烦
答案 0 :(得分:0)
Response.AppendHeader("Content-Disposition", "attachment; filename=" + "test101.filetype");
我的错 - 我没有在我的数据库中包含文件扩展名 感谢您的评论!