Response Confirmation

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top