Unable to download file from Amazon CloudFront CDN

Jun 23, 2014 at 3:40 PM
Hello,

I have installed the SharpBits 2.1.0 NuGet and wrote the following sample console application to attempt to download a file from an Amazon CloudFront CDN:
class Program
{
    static void Main()
    {
        using (var manager = new BitsManager())
        {
            foreach (var j in manager.EnumJobs(JobOwner.CurrentUser))
            {
                Console.WriteLine("{0} - {1} - {2}", j.Key, j.Value.DisplayName, j.Value.Progress.BytesTransferred);
            }

            BitsJob job = manager.CreateJob("TestJob", JobType.Download);

            job.AddFile("http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png", "C:\\work\\download.png");
            job.ProxySettings.ProxyUsage = ProxyUsage.Preconfig;
            job.ProxySettings.ProxyList = "http://localhost:8888";
            job.Resume();
            job.OnJobTransferred += (sender, e) =>
            {
                Console.WriteLine("OnJobTransferred");
            };

            job.OnJobModified += (sender, e) =>
            {
                Console.WriteLine("{0} bytes transferred", job.Progress.BytesTransferred);
            };

            job.OnJobError += (sender, e) =>
            {
                Console.WriteLine("Error: {0}", e.Error.Description);
                job.Cancel();
            };

            Console.WriteLine("job started...");
            Console.ReadLine();
        }
    }
}
Unfortunately the OnJobError callback always get triggered with the following message:
The server does not support the necessary HTTP protocol. Background Intelligent Transfer Service (BITS) requires that the server support the Range protocol header.
From the Fiddler log I can see 5 HTTP requests:
HEAD http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png
GET http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png
GET http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png
GET http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png
GET http://s0.cyberciti.org/images/misc/static/2012/11/ifdata-welcome-0.png
Each of the GET requests has the following Range headers:
Range: bytes=0-4515
Range: bytes=0-4746
Range: bytes=0-4595
Range: bytes=0-4708
But the server always returns Content-Length of 30354 bytes and streams the entire image.

Could the problem be related to some proxy between the client and the CloudFront server? Currently there's a (Cisco-IronPort-WSA/7.5.2-118) in between and I am wondering if this could interfere with the requests and not support ranged downloads?

Thanks in advance,
Darin.