Skip to content
Snippets Groups Projects
Commit 22b2b86b authored by Anthony Borghi's avatar Anthony Borghi
Browse files

retouche pour l'ouverture en inline à travers le filedownloader

parent 5c3a3832
No related branches found
No related tags found
No related merge requests found
<?php <?php
ob_end_flush();
$aCurrentHeaders = apache_response_headers();
if(!array_key_exists('Content-Type-Set-By', $aCurrentHeaders)){
header('Content-type: '.$aValues['output'].'; charset='.$properties["page_encoding"]); header('Content-type: '.$aValues['output'].'; charset='.$properties["page_encoding"]);
}
echo $sMessage; echo $sMessage;
?> ?>
...@@ -128,8 +128,9 @@ class FileDownloader extends Vitis { ...@@ -128,8 +128,9 @@ class FileDownloader extends Vitis {
return array("status" => 1, "fileName" => $sFileName); return array("status" => 1, "fileName" => $sFileName);
} }
header("Content-Type: " . $sContentType); header("Content-Type: " . $sContentType .'; charset='. $this->aProperties["page_encoding"]);
if (in_array($sContentType, array("text/plain", 'application/pdf', 'text/html'))){ header("Content-Type-Set-By: vitis/filedownloader");
if (in_array($sContentType, array("text/plain", 'application/pdf', 'text/html', 'application/xml', 'application/json'))){
header("Content-disposition: inline; filename=\"" . rawurlencode($sFileName) . "\""); header("Content-disposition: inline; filename=\"" . rawurlencode($sFileName) . "\"");
} else { } else {
header("Content-disposition: attachment; filename=\"" . rawurlencode($sFileName) . "\""); header("Content-disposition: attachment; filename=\"" . rawurlencode($sFileName) . "\"");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment