We get this error from the BITS job when trying to download a zip file from a remote server (we implemented an HTTP Handler for zip files on that server):
ERROR CODE: 0x80200013 - The server does not support the necessary HTTP protocol. Background Intelligent Transfer Service (BITS) requires that the server support the Range protocol header.
ERROR CONTEXT: 0x00000005 - The error occurred while the remote file was being processed.
My understanding is that the error suggests we should add the Content-Range header. I added the header, now the code looks like below:
context.Response.ContentType = "application/x-zip-compressed";
context.Response.AppendHeader("Content-Disposition", string.Format("inline; fileName={0}", downloadFileName));
context.Response.AppendHeader("Content-Range", "bytes " + start + "-" + end + "/" + size);
context.Response.AppendHeader("Content-Length", fs.Length.ToString());
fs.CopyTo(context.Response.OutputStream);
context.Response.Flush();
context.Response.Close();
, but I keep receiving the same error.
I also tried the following line:
context.Response.AppendHeader("Accept-Ranges", "bytes");
but ended up with a different error: "The connection with the server was terminated abnormally". The download link works perfectly fine in the browser.
i will appreciate any ideas, thanks!