Compare commits

..

No commits in common. "81ecd9ff7fef48a25a2045d08a4c006707e75d1d" and "805176c3eaa2ab3477001777927bc201c5ca5f7c" have entirely different histories.

1 changed files with 3 additions and 3 deletions

View File

@ -591,17 +591,17 @@ public class OSSService : IOSSService
//client.DeleteObject(sourceBucket, sourceKey); //client.DeleteObject(sourceBucket, sourceKey);
// 执行复制 // 执行复制
var copyRequestAli = new Aliyun.OSS.CopyObjectRequest( var copyRequest = new Aliyun.OSS.CopyObjectRequest(
sourceBucket, sourceKey, sourceBucket, sourceKey,
destBucket, destKey); destBucket, destKey);
// 保持原文件元数据 // 保持原文件元数据
copyRequestAli.NewObjectMetadata = new ObjectMetadata copyRequest.NewObjectMetadata = new ObjectMetadata
{ {
ContentType = client.GetObjectMetadata(sourceBucket, sourceKey).ContentType ContentType = client.GetObjectMetadata(sourceBucket, sourceKey).ContentType
}; };
var result = client.CopyObject(copyRequestAli); var result = client.CopyObject(copyRequest);
// 删除原文件(仅在复制成功后) // 删除原文件(仅在复制成功后)
client.DeleteObject(sourceBucket, sourceKey); client.DeleteObject(sourceBucket, sourceKey);