From: Jörn Friedrich Dreyer Date: Tue, 21 Oct 2014 10:58:26 +0000 (+0200) Subject: guess mimetype on touch X-Git-Tag: v8.0.0alpha1~466^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c9004409b70461b61d9e6491584f1de6399a2be;p=nextcloud-server.git guess mimetype on touch --- diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 808de16c8a8..ae306fac420 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -457,11 +457,13 @@ 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, - 'Body' => '' + 'Body' => '', + 'ContentType' => $mimeType )); $this->testTimeout(); } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 6a1e12986fb..22a18202512 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -406,7 +406,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);