存到数据库中的时候是以DocumentText方法保存上传到数据库中的,现在想读取出来,我是用下面的方法读的
int num = pModel.Reason1.Length;
Response.ContentType = "Application/msword";
Response.AddHeader("Content-Disposition", "attachment; filename=new.doc");
Response.AddHeader("Content-Length", num.ToString());
this.Response.Clear();
System.IO.TextWriter sd = this.Response.Output;
sd.Write(pModel.Reason1, 0, num);
sd.Close();
但是读取后文字的格式不一样了,请问下应该怎么该?
求救!怎么读取Doc文件以ntext类型保存在数据库的值
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- threenewbee 2015-07-22 06:01关注
当然,word是二进制文件,不要用ntext,应该用binary
http://www.cnblogs.com/xinchun/p/3482390.html解决 无用评论 打赏 举报