mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
allow to specify a filename on permalink usage
This commit is contained in:
@@ -34,11 +34,14 @@ abstract class AbstractDelivery
|
|||||||
{
|
{
|
||||||
$mediaSubdefinition = $record->get_subdef($subdef);
|
$mediaSubdefinition = $record->get_subdef($subdef);
|
||||||
|
|
||||||
|
$filename = $request->get("filename") ?: $mediaSubdefinition->get_file();
|
||||||
|
|
||||||
$pathOut = $this->tamperProofSubDefinition($mediaSubdefinition, $watermark, $stamp);
|
$pathOut = $this->tamperProofSubDefinition($mediaSubdefinition, $watermark, $stamp);
|
||||||
|
|
||||||
$disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE;
|
$disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE;
|
||||||
|
|
||||||
$response = $this->deliverFile($pathOut, $mediaSubdefinition->get_file(), $disposition, $mediaSubdefinition->get_mime());
|
// nb: $filename will be sanitized, no need to do it here
|
||||||
|
$response = $this->deliverFile($pathOut, $filename, $disposition, $mediaSubdefinition->get_mime());
|
||||||
|
|
||||||
if (in_array($subdef, array('document', 'preview'))) {
|
if (in_array($subdef, array('document', 'preview'))) {
|
||||||
$response->setPrivate();
|
$response->setPrivate();
|
||||||
|
Reference in New Issue
Block a user