Merge pull request #11684 from owncloud/guess_mimetype_on_touch
guess mimetype on touch
This commit is contained in:
commit
a9aa7841c9
|
@ -457,11 +457,13 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
));
|
));
|
||||||
$this->testTimeout();
|
$this->testTimeout();
|
||||||
} else {
|
} else {
|
||||||
|
$mimeType = \OC_Helper::getMimetypeDetector()->detectPath($path);
|
||||||
$this->connection->putObject(array(
|
$this->connection->putObject(array(
|
||||||
'Bucket' => $this->bucket,
|
'Bucket' => $this->bucket,
|
||||||
'Key' => $this->cleanKey($path),
|
'Key' => $this->cleanKey($path),
|
||||||
'Metadata' => $metadata,
|
'Metadata' => $metadata,
|
||||||
'Body' => ''
|
'Body' => '',
|
||||||
|
'ContentType' => $mimeType
|
||||||
));
|
));
|
||||||
$this->testTimeout();
|
$this->testTimeout();
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,7 +406,8 @@ class Swift extends \OC\Files\Storage\Common {
|
||||||
$object->saveMetadata($metadata);
|
$object->saveMetadata($metadata);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$customHeaders = array('content-type' => 'text/plain');
|
$mimeType = \OC_Helper::getMimetypeDetector()->detectPath($path);
|
||||||
|
$customHeaders = array('content-type' => $mimeType);
|
||||||
$metadataHeaders = DataObject::stockHeaders($metadata);
|
$metadataHeaders = DataObject::stockHeaders($metadata);
|
||||||
$allHeaders = $customHeaders + $metadataHeaders;
|
$allHeaders = $customHeaders + $metadataHeaders;
|
||||||
$this->container->uploadObject($path, '', $allHeaders);
|
$this->container->uploadObject($path, '', $allHeaders);
|
||||||
|
|
Loading…
Reference in New Issue