summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis <louis@chmn.me>2023-11-07 08:46:52 +0100
committerGitHub <noreply@github.com>2023-11-07 08:46:52 +0100
commit8b6750ceac4593e81fe07fb6c22eb1bc8ea2a943 (patch)
treed21e654861066d7d28e659700d04f9feb8d7528a
parentfb3f63cc7f7f15af5e605786e831b62d9caa5f14 (diff)
parent17ca96d20514b9de6417ccf2155607f58858a68d (diff)
downloadnextcloud-server-8b6750ceac4593e81fe07fb6c22eb1bc8ea2a943.tar.gz
nextcloud-server-8b6750ceac4593e81fe07fb6c22eb1bc8ea2a943.zip
Merge pull request #41236 from nextcloud/backport/41062/stable27
[stable27] Return correct status if touch failed
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index e9398815055..8e2a6b8ea12 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -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',