mirror of
https://github.com/nextcloud/server.git
synced 2026-04-28 01:28:08 -04:00
Merge pull request #41236 from nextcloud/backport/41062/stable27
[stable27] Return correct status if touch failed
This commit is contained in:
commit
8b6750ceac
1 changed files with 13 additions and 11 deletions
|
|
@ -550,18 +550,20 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
];
|
||||
|
||||
try {
|
||||
if (!$this->file_exists($path)) {
|
||||
$mimeType = $this->mimeDetector->detectPath($path);
|
||||
$this->getConnection()->putObject([
|
||||
'Bucket' => $this->bucket,
|
||||
'Key' => $this->cleanKey($path),
|
||||
'Metadata' => $metadata,
|
||||
'Body' => '',
|
||||
'ContentType' => $mimeType,
|
||||
'MetadataDirective' => 'REPLACE',
|
||||
]);
|
||||
$this->testTimeout();
|
||||
if ($this->file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$mimeType = $this->mimeDetector->detectPath($path);
|
||||
$this->getConnection()->putObject([
|
||||
'Bucket' => $this->bucket,
|
||||
'Key' => $this->cleanKey($path),
|
||||
'Metadata' => $metadata,
|
||||
'Body' => '',
|
||||
'ContentType' => $mimeType,
|
||||
'MetadataDirective' => 'REPLACE',
|
||||
]);
|
||||
$this->testTimeout();
|
||||
} catch (S3Exception $e) {
|
||||
$this->logger->error($e->getMessage(), [
|
||||
'app' => 'files_external',
|
||||
|
|
|
|||
Loading…
Reference in a new issue