asp 本地上传.doc 附件,本地可浏览.但是远程其他机器不能浏览??
如题..
为什么不能浏览,只是页面散一下就没了..什么原因??
代码:
string strClID = Request.QueryString["ClID"];
Database db = new Database();
try
{
SqlDataReader dataReader;
SqlParameter[] parameters = {
db.MakeInParam("@SYS_ACTION",SqlDbType.Char,3,"INF"),
db.MakeInParam("@ClID",SqlDbType.Int,4,Convert.ToInt32( strClID )),
};
db.RunProc("sp_Sssb_Cl", parameters, out dataReader);
if (dataReader.Read())
{
if (dataReader["zp"].GetType().ToString() == "System.DBNull")
{
Response.Write("没有附件可以显示!");
}
else
{
byte[] fj = (byte[])dataReader["zp"];
if (fj.Length == 0)
{
Response.Write("没有附件可以显示!");
}
else
{
Response.ContentType = "application/msword";
Response.BinaryWrite((byte[])dataReader["zp"]);
}
}
}
}
catch (Exception ex)
{
ErrLog.AddErrLog("2", "sp_Sssb_Cl(Show -- Edit)", ex.Message);
Response.Write(" <script language=javascript>alert('" + ex.ToString() + "'); </script>");
}
finally
{
db.Close();
}