ASP.NET vs. ISAPI for File Downloads

B

Ben Rush

I see the most common way to monitor the number of bytes actually sent
to the client in ASP.NET for a file download is by placing a
Response.Write() into a loop and incrementing a counter as you stream
bytes down; I have seen no better examples posted on the net or in the
newsgroups than this. There exists the Response.WriteFile() and
Response.TransmitFile() APIs, but none of them give the ability to
determine how many bytes, exactly, were transmitted to the client (say
the client closes his/her browser half-way through the download
process and the client's socket closes - not all file bits were
transferred).

Not using any third-party applications, is this possible in ASP.NET?
With ISAPI I can run a TransmitFile and have IIS notify me via
callback how many bytes were transferred when the process ended for
whatever reason.

I would appreciate any response on this topic as I find it hard to
believe that such functionality is only available in ISAPI. The
Response.Write() loop is kind of goofy and I'm finding it to be
inefficient in practice.

TIA,
Ben
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top