[Pkg-owncloud-commits] [owncloud] 37/46: guess mimetype on touch

David Prévot taffit at moszumanska.debian.org
Fri Oct 24 15:11:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 6995b965891de9bb128002291c99001322fddd4b
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Tue Oct 21 12:58:26 2014 +0200

    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 bbb1b14..06910e0 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 47ab329..3b298df 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list