mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Merge branch 'hotfix' into 3.6
This commit is contained in:
@@ -1031,39 +1031,19 @@ class set_export extends set_abstract
|
|||||||
public static function stream_data($data, $exportname, $mime, $disposition='attachment')
|
public static function stream_data($data, $exportname, $mime, $disposition='attachment')
|
||||||
{
|
{
|
||||||
|
|
||||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
header("Pragma: public");
|
header("Pragma: no-cache");
|
||||||
header("Content-Type: " . $mime);
|
header("Content-Type: " . $mime);
|
||||||
header("Content-Length: " . strlen($data));
|
header("Content-Length: " . strlen($data));
|
||||||
header("Cache-Control: max-age=3600, must-revalidate ");
|
header("Cache-Control: max-age=3600, must-revalidate ");
|
||||||
header("Content-Disposition: " . $disposition . "; filename=" . $exportname . ";");
|
header("Content-Disposition: " . $disposition
|
||||||
echo $data;
|
. "; filename=" . $exportname . ";");
|
||||||
exit();
|
|
||||||
$response = new \Symfony\Component\HttpFoundation\Response();
|
echo $data;
|
||||||
$response->headers->set('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
|
|
||||||
$response->setLastModified(new DateTime());
|
|
||||||
$response->headers->set('Pragma', 'public', true);
|
|
||||||
$response->headers->set('Content-Type', $mime);
|
|
||||||
$response->headers->set('Content-Length', strlen($data));
|
|
||||||
$response->headers->set('Content-Disposition', $disposition. "; filename=" . $exportname . ";");
|
|
||||||
// header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
|
||||||
// header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
|
||||||
// header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
|
||||||
//
|
|
||||||
// header("Pragma: public");
|
|
||||||
//
|
|
||||||
// header("Content-Type: " . $mime);
|
|
||||||
// header("Content-Length: " . strlen($data));
|
|
||||||
// header("Cache-Control: max-age=3600, must-revalidate ");
|
|
||||||
// header("Content-Disposition: " . $disposition
|
|
||||||
// . "; filename=" . $exportname . ";");
|
|
||||||
//
|
|
||||||
// echo $data;
|
|
||||||
$response->send();
|
|
||||||
exit();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user