我尝试在oracle云基础结构上上传,但是每当设置SendChunked = true
时都会抛出错误411,但是在删除所有内容后一切正常。我想要实现SendChunked = true
,因为我想分块上传数据。 br />
请查看代码并查找错误。
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
FileStream rdr = new FileStream(fileToUpload, FileMode.Open, FileAccess.Read);
var uri = new Uri($"https://objectstorage.us-phoenix-1.oraclecloud.com/n/{Namespace}/b/{bucket}/o/gradetest ");
var request = (HttpWebRequest)WebRequest.Create(uri);
request.SendChunked = true;
request.Method = "PUT";
request.Accept = "application/json";
request.ContentType = "application/zip";
request.KeepAlive = false;
request.Timeout =600000;
request.ContentLength = rdr.Length;
request.AllowReadStreamBuffering = false;
request.AllowWriteStreamBuffering = false;