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
Post a Comment