我究竟做错了什么?我有授权,我有存储桶,我有文件但我无法上传它,而且它太大而无法使用 UploadObject。
这是我的代码上传的一部分
using (StreamReader streamReader = new StreamReader(filePath))
{ Byte[] buffer = new Byte[2097153];
var QtdeBytesFaltantes = streamReader.BaseStream.Length;
var byteInicio = 0;
var byteFim = 0;
while (QtdeBytesFaltantes > 0)
{
byteFim = await streamReader.BaseStream.ReadAsync(buffer, 0, buffer.Length);
await objectsApi.UploadChunkAsync(bucketKey,
Path.GetFileName(filePath),
(int)streamReader.BaseStream.Length,
"bytes " + byteInicio + "-" + byteFim + "/" + (int)streamReader.BaseStream.Length,
"IdUnicoDaSessao",
streamReader.BaseStream);
QtdeBytesFaltantes -= buffer.Length;
byteInicio = byteFim + 1;
}
dynamic response = await objectsApi.GetObjectAsync(bucketKey, Path.GetFileName(filePath));
return response;