请协助。 我使用以下代码段成功将对象上传到S3:
// Send a PutObject request and get the result object.
$result = $this->s3EncryptionClient->putObject([
'@MaterialsProvider' => $this->materialsProvider,
'@CipherOptions' => $this->cipherOptions,
'Bucket' => $this->s3BucketName,
'Key' => $key,
'ContentType' => $mimeType,
'ContentLength' => filesize($filePath),
'ContentDisposition' => "attachment; filename='" . $fileName . "'",
'Body' => fopen($filePath ,'r')
]);
我可以使用以下代码段成功下载对象:
// Download the contents of the object.
$result = $this->s3EncryptionClient->getObject([
'@MaterialsProvider' => $this->materialsProvider,
'@CipherOptions' => $this->cipherOptions,
'Bucket' => $this->s3BucketName,
'Key' => $key
]);
当我尝试使用以下代码片段复制对象时出现问题:
$result = $this->s3Client->CopyObject([
'Bucket' => $this->s3BucketName,
'CopySource' => $CopySource,
'Key' => $dstKey,
]);
该对象似乎被错误地复制,并且当我尝试使用我在本文前面粘贴的下载代码下载新对象时,找不到该对象,并且出现了AWSException
导致
404 Not Found
响应
您知道如何解决该问题吗?