c# - .Net HttpResponse transmitFile eventListener or progressCallback? -


i'm using httpresponse.transmitfile on iis .net application downloading large files. wondering if there's event listener or progress callback can attach transmitfile method or response, server know progress of download, , abort if necessary?

i can think of way of artificially chunking file , flush response per chunk, i'm little worried performance.

long chunksize = 65536; while (checkcontinue()) {     if (index >= filelength)         break;     if (index<filelength && index + chunksize> filelength)     {         context.response.transmitfile(fulltarget, index, filelength - index);         context.response.flush();         break;     }      context.response.transmitfile(fulltarget, index, chunksize);     context.response.flush();     index += chunksize; } 

any suggestions? in advance.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -