Provide file size estimate in HTTP download

时间:2016-07-11 20:54:14

标签: asp.net http download

A bit of background, I've implemented a streaming ZipArchive stream to allow user to download a large number of files at the same time. Writing to ZipArchive using Http OutputStream

Obviously, I won't know the size of the zip-file at the start of download, so I'm unable to set the Content-Length. Waiting for the zip-file to generate is not an option, as the ZipArchive generation can take up to several minutes (it's a pretty large number of files).

However, I still want to inform the user some sort of rough progress (like, the number of files they've received, or a rough estimate on the Content-Length). Is there any existing/upcoming protocol that either:

  1. Allow specification of an estimated Content-Length type header (that browser only use as a reference instead of an exact length).
  2. With chunked transfer protocol, specify number of chunks.

0 个答案:

没有答案