diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-10-22 12:32:09 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-10-22 12:32:09 +0200 |
commit | a9aa7841c94f8ea2ed924c6e59ea9119295ae775 (patch) | |
tree | b524cca6795518713ead88a48b2a209a07518349 /apps | |
parent | b7718bc212e7579ad15c51d48447ff4eca44bff6 (diff) | |
parent | 1c9004409b70461b61d9e6491584f1de6399a2be (diff) | |
download | nextcloud-server-a9aa7841c94f8ea2ed924c6e59ea9119295ae775.tar.gz nextcloud-server-a9aa7841c94f8ea2ed924c6e59ea9119295ae775.zip |
Merge pull request #11684 from owncloud/guess_mimetype_on_touch
guess mimetype on touch
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/amazons3.php | 4 | ||||
-rw-r--r-- | 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 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); |