guess mimetype on touch

This commit is contained in:
Jörn Friedrich Dreyer 2014-10-21 12:58:26 +02:00
parent 3e499d1ac4
commit 1c9004409b
2 changed files with 5 additions and 2 deletions

View file

@ -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();
}

View file

@ -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);