Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 127:       context.Response.ContentType = "image/png";
Line 128:       context.Response.AddHeader("Content-Disposition", "attachment; filename=" + stdid + ".png");
Line 129:       context.Response.BinaryWrite(downloadFile(ConfigurationManager.AppSettings["ftpserver"]+ "/Thumbnail/", ReqPath(orgs, stdid), ConfigurationManager.AppSettings["ftpuser"], ConfigurationManager.AppSettings["ftppass"]));
Line 130:       context.Response.End();
Line 131:        

Source File: c:\inetpub\vhosts\standardsmanager.ir\httpdocs\en\preview.ashx    Line: 129

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.HttpResponse.BinaryWrite(Byte[] buffer) +15
   preview.ProcessRequest(HttpContext context) in c:\inetpub\vhosts\standardsmanager.ir\httpdocs\en\preview.ashx:129
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +598
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +170


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062