SAAS-922 take 2
This commit is contained in:
parent
934b3fb764
commit
ffb55de566
|
@ -363,14 +363,6 @@ class CcFiles extends BaseCcFiles {
|
||||||
unset($response[$key]);
|
unset($response[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mime = $file->getDbMime();
|
|
||||||
if (!empty($mime)) {
|
|
||||||
// Get an extension based on the file's mime type and change the path to use this extension
|
|
||||||
$path = pathinfo($file->getDbFilepath());
|
|
||||||
$ext = FileDataHelper::getFileExtensionFromMime($mime);
|
|
||||||
$response["filepath"] = ($path["dirname"] . '/' . $path["filename"] . $ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,8 +377,12 @@ class CcFiles extends BaseCcFiles {
|
||||||
public function getFilename()
|
public function getFilename()
|
||||||
{
|
{
|
||||||
$info = pathinfo($this->getAbsoluteFilePath());
|
$info = pathinfo($this->getAbsoluteFilePath());
|
||||||
|
|
||||||
//filename doesn't contain the extension because PHP is awful
|
//filename doesn't contain the extension because PHP is awful
|
||||||
return $info['filename'].".".$info['extension'];
|
$mime = $this->getDbMime();
|
||||||
|
$extension = FileDataHelper::getFileExtensionFromMime($mime);
|
||||||
|
|
||||||
|
return $info['filename'].".".$extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -62,6 +62,7 @@ class Application_Service_MediaService
|
||||||
|
|
||||||
if ($media->getPropelOrm()->isValidPhysicalFile()) {
|
if ($media->getPropelOrm()->isValidPhysicalFile()) {
|
||||||
$filename = $media->getPropelOrm()->getFilename();
|
$filename = $media->getPropelOrm()->getFilename();
|
||||||
|
|
||||||
//Download user left clicks a track and selects Download.
|
//Download user left clicks a track and selects Download.
|
||||||
if (!$inline) {
|
if (!$inline) {
|
||||||
//We are using Content-Disposition to specify
|
//We are using Content-Disposition to specify
|
||||||
|
|
Loading…
Reference in New Issue