我试图通过GET从OpenStack下载对象。 这些文件正常下载,除了WebClient在一开始就将标题附加到每一个文件中,如下所示:
-------------------------------28947758029299
Content-Disposition: form-data; name=""; filename="v30fDviSwYNfLlN0-a0D0w9pi.zip"
Content-Type: application/octet-stream
这是我的代码:
WebClient client = new WebClient ();
client.Headers.Set ("X-Auth-Token", OktawaveApi.Token);
// Download progress
client.DownloadProgressChanged += delegate(object sender, DownloadProgressChangedEventArgs e) {
progressCallback (e.ProgressPercentage);
};
// Download completed.
client.DownloadFileCompleted += delegate(object sender, System.ComponentModel.AsyncCompletedEventArgs e) {
completeCallback (true);
};
client.DownloadFileAsync (new Uri(OktawaveApi.StorageURL + "/" + parent.Name + "/" + Name), targetPath);
有没有办法解决这个问题?