J
jhansl
Hello,
I am working with ASP.NET and I'm trying to find a way to confirm that
a downloaded file was received by the client machine. I am currently
overriding the Render method to gather the entire response text before
I send it out to the clients browser:
protected override void Render(HtmlTextWriter writer)
{
StringBuilder _stringBuilder = new StringBuilder();
StringWriter _stringWriter = new StringWriter(_stringBuilder);
HtmlTextWriter _htmlWriter = new HtmlTextWriter(_stringWriter);
base.Render(_htmlWriter);
String html = _stringBuilder.ToString();
// the html string contains the string to the browser
writer.Write(html);
}
This works well, but I need a way to confirm that the response was not
cut off due to either the user cancelling the download or some
unforseen internet problem. If I had access to the socket layer, I
could just wait for a timeout on the send, but I know of no way to get
access to this information in ASP.NET. I even tried putting the Write
method in a try/catch hoping that it would generate an exception if
there was a transmission problem, but it simply just returns instantly
with no error.
Any help would be greatly appreciated.
Josh
I am working with ASP.NET and I'm trying to find a way to confirm that
a downloaded file was received by the client machine. I am currently
overriding the Render method to gather the entire response text before
I send it out to the clients browser:
protected override void Render(HtmlTextWriter writer)
{
StringBuilder _stringBuilder = new StringBuilder();
StringWriter _stringWriter = new StringWriter(_stringBuilder);
HtmlTextWriter _htmlWriter = new HtmlTextWriter(_stringWriter);
base.Render(_htmlWriter);
String html = _stringBuilder.ToString();
// the html string contains the string to the browser
writer.Write(html);
}
This works well, but I need a way to confirm that the response was not
cut off due to either the user cancelling the download or some
unforseen internet problem. If I had access to the socket layer, I
could just wait for a timeout on the send, but I know of no way to get
access to this information in ASP.NET. I even tried putting the Write
method in a try/catch hoping that it would generate an exception if
there was a transmission problem, but it simply just returns instantly
with no error.
Any help would be greatly appreciated.
Josh