public override Task <StorageUploadParameters> RequestUpload(RequestUploadOptions options) { var headers = new Dictionary <string, string>(); if (options.Length > 0) { headers.Add("Content-Length", options.Length.ToString()); } var url = cos.GenerateSignURL(new COSXML.Model.Tag.PreSignatureStruct { isHttps = true, httpMethod = "PUT", appid = cosConfig.Appid, bucket = this.bucket, region = cosConfig.Region, headers = headers, key = options.DestFilePath, }); return(Task.FromResult(new StorageUploadParameters { Url = url, Method = "PUT" })); }
public virtual async Task PutFile(RequestUploadOptions options, string srcFilePath) { var p = await RequestUpload(options); using (var fs = File.OpenRead(srcFilePath)) { await new HttpClient().PutAsync(p.Url, new StreamContent(fs)); } }
public virtual Task <StorageUploadParameters> RequestUpload(RequestUploadOptions options) { throw new NotImplementedException(); }