Second fix for SAAS-922, file extension improvements for S3

This commit is contained in:
Albert Santoni 2015-07-15 17:51:37 -04:00
parent 064e1bd4e0
commit ffaa076767
2 changed files with 9 additions and 2 deletions

View file

@ -49,7 +49,14 @@ class CloudFile extends BaseCloudFile
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;
}
/**