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