用二进制流把附件存到oracle数据库中,然后取出时,附件名是乱码~,webconfig里设置的是gb2312;
取附件代码如下: if (dr.Read())
{
string attachment = "attachment;filename="+Server.UrlEncode(dr.GetString(1).ToString()); OracleLob myLob = dr.GetOracleLob(0);
int myLength = Convert.ToInt32(myLob.Length);  
Byte[] Buffer = new byte[myLength];      
myLob.Read(Buffer,0,myLength);
this.Response.Clear();
this.Response.ContentType = dr.GetString(1).ToString();
this.Response.AppendHeader("Content-Disposition",attachment);
this.Response.ContentType = "application/ms-word";
this.Response.BinaryWrite(Buffer);
this.Response.End();
}取出的附件名只要是中文部分就是乱码,谁能帮忙一下~