Second fix for SAAS-922, file extension improvements for S3
This commit is contained in:
parent
064e1bd4e0
commit
ffaa076767
|
@ -46,7 +46,7 @@ class Amazon_S3StorageBackend extends StorageBackend
|
||||||
{
|
{
|
||||||
$urls = array();
|
$urls = array();
|
||||||
|
|
||||||
$s3args = array('response-content-disposition', "attachment; filename=" . urlencode($contentDispositionFilename));
|
$s3args = array('ResponseContentDisposition' => 'attachment; filename="' . $contentDispositionFilename. '"');
|
||||||
$signedS3Url = $this->s3Client->getObjectUrl($this->getBucket(), $resourceId, '+60 minutes', $s3args);
|
$signedS3Url = $this->s3Client->getObjectUrl($this->getBucket(), $resourceId, '+60 minutes', $s3args);
|
||||||
|
|
||||||
//If we're using the proxy cache, we need to modify the request URL after it has
|
//If we're using the proxy cache, we need to modify the request URL after it has
|
||||||
|
|
|
@ -49,7 +49,14 @@ class CloudFile extends BaseCloudFile
|
||||||
|
|
||||||
public function getFilename()
|
public function getFilename()
|
||||||
{
|
{
|
||||||
return $this->getDbFilepath();
|
$filename = $this->getDbFilepath();
|
||||||
|
$info = pathinfo($filename);
|
||||||
|
|
||||||
|
//Add the correct file extension based on the MIME type, for files that were uploaded with the wrong extension.
|
||||||
|
$mime = $this->getDbMime();
|
||||||
|
$extension = FileDataHelper::getFileExtensionFromMime($mime);
|
||||||
|
|
||||||
|
return $info['filename'] . $extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue