From 6995b965891de9bb128002291c99001322fddd4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 21 Oct 2014 12:58:26 +0200 Subject: [PATCH] guess mimetype on touch Conflicts: apps/files_external/lib/amazons3.php --- apps/files_external/lib/amazons3.php | 4 +++- apps/files_external/lib/swift.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index bbb1b14f848..06910e04f2a 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -457,10 +457,12 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } else { + $mimeType = \OC_Helper::getMimetypeDetector()->detectPath($path); $this->connection->putObject(array( 'Bucket' => $this->bucket, 'Key' => $this->cleanKey($path), - 'Metadata' => $metadata + 'Metadata' => $metadata, + 'ContentType' => $mimeType )); $this->testTimeout(); } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 47ab3294673..3b298df8c32 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -396,7 +396,8 @@ class Swift extends \OC\Files\Storage\Common { $object->saveMetadata($metadata); return true; } else { - $customHeaders = array('content-type' => 'text/plain'); + $mimeType = \OC_Helper::getMimetypeDetector()->detectPath($path); + $customHeaders = array('content-type' => $mimeType); $metadataHeaders = DataObject::stockHeaders($metadata); $allHeaders = $customHeaders + $metadataHeaders; $this->container->uploadObject($path, '', $allHeaders); -- 2.39.5