summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-10-23 15:26:43 +0200
committerLouis Chemineau <louis@chmn.me>2023-10-23 15:26:43 +0200
commite66e8bad1a711ec3073e901e824edc3f92dbd107 (patch)
tree1dafd8a97572488ecd94bc054247bcfdea7456c3 /apps/files_external
parent834c9a209ebef7b8d5795b53a018577fe4e534ca (diff)
downloadnextcloud-server-e66e8bad1a711ec3073e901e824edc3f92dbd107.tar.gz
nextcloud-server-e66e8bad1a711ec3073e901e824edc3f92dbd107.zip
Return correct status if touch failed
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_external')
-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',