private void AttachDownLoad(int intAttachID)
{
string strAttachId = intAttachID.ToString();
string strTable = "Subject_Attach";
string strSQL = "select * from Subject_Attach where attachid="+strAttachId;
DataRow objRow = DbTools.GetRow(strSQL);
byte[] Buffer= (byte[])objRow["filebody"];
if(!File.Exists(strDownloadPath+strTable+"_"+objRow["Attachid"].ToString()+".tmp"))
{
FileStream objFS=new FileStream(strDownloadPath +strTable+"_"+objRow["Attachid"].ToString() + ".tmp",FileMode.OpenOrCreate,FileAccess.Write);
objFS.Write(Buffer,0,Buffer.Length);
objFS.Close();
}
//Response.ContentType=objDtr["attach_extname"].ToString();
Response.AddHeader("Content-Disposition","attachment;filename=" + HttpUtility.UrlEncode(objRow["filename"].ToString(),System.Text.Encoding.UTF8));
Response.WriteFile(strDownloadPath + strTable+"_" + objRow["Attachid"].ToString() + ".tmp");
Response.Flush();
Response.End();
}
#endregion