diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-10-21 12:58:26 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-10-21 12:58:26 +0200 |
commit | 1c9004409b70461b61d9e6491584f1de6399a2be (patch) | |
tree | e33498ee63a7dc4c1400dbd867516d8b09529b99 /apps/files_external | |
parent | 3e499d1ac4fb18ee24c7a7aa032619a21e08a97f (diff) | |
download | nextcloud-server-1c9004409b70461b61d9e6491584f1de6399a2be.tar.gz nextcloud-server-1c9004409b70461b61d9e6491584f1de6399a2be.zip |
guess mimetype on touch
Diffstat (limited to 'apps/files_external')
-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); |