JenebyM
asked on
Thread was being aborted
I have implemented the solution as indicated but can't seem to find the code block that is generating the error.
Are you able to check this code and see where this exception is occurring. It could be something quite simple. Its been a long day.
Thanks
Are you able to check this code and see where this exception is occurring. It could be something quite simple. Its been a long day.
Thanks
sqlr = cmd.ExecuteReader();
while (sqlr.Read())
{
if (!sqlr.IsDBNull(0) && !sqlr.IsDBNull(1))
{
bytDocument = (byte[])sqlr["SupportingDocument"];
strExt = sqlr.GetString(1).ToLower();
}
else
{
//My messages here
return;
}
}
sqlr.close();
strFileName = "test";
Response.Clear();
// Response.ContentType = "application/octet-stream";
switch (strExt.ToUpper())
{
case "PDF":
Response.ContentType = "application/pdf";
break;
case "JPG":
}
//Tell browser to save rather than display inline.
Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFileName+strExt);
Response.AddHeader("Content-Length", myFile.Length.ToString());
Response.BinaryWrite(bytDocument);
Response.Flush();
Response.End();
}
catch (Exception)
{
//Show processing error
}
finally
{
cn.Close();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This closes the question. Thanks for helping a very tired mind.
Regards