ラックスペース ファイルから openstack SDK を使用してファイルをダウンロードしようとしています。ファイルが既に存在する場合は、範囲ヘッダーを使用して、中断したところから書き込みを続けたいと考えています。彼らのドキュメントによると、これは達成できます。openstack SDK のドキュメントには、範囲ヘッダーを設定できると記載されています。これが私のコードです:
Dictionary<string, string> headers = new Dictionary<string,string>();
if (File.Exists(@"C:\path\to\file.zip"))
{
long iExistLen = 0;
System.IO.FileInfo fINfo =
new System.IO.FileInfo(@"C:\path\to\file.zip");
iExistLen = fINfo.Length;
headers.Add("Range", "bytes="+iExistLen+"-");
}
CloudIdentity cloudIdentity = new CloudIdentity()
{
APIKey = apikey,
Username = username
};
CloudFilesProvider cloudFilesProvider = new CloudFilesProvider(cloudIdentity);
cloudFilesProvider.GetObjectSaveToFile(containerName, @"C:\path\to\", fileName, "file.zip", 65536, headers);
これを実行すると、次のエラーが表示されます。
The 'Range' header must be modified using the appropriate property or method.
どんな助けでも大歓迎です。
ありがとう。