When you open a pdf with php in the title, the name of the php script appears

0

Good day! I have the following code to open a pdf via sftp and show it (inline). Everything works fine, but at the top left is the name of the script php (eg " miscript.php ") instead of the file name ( $srcFile ). To download it works correctly.

<?
... 
$stream = fopen("ssh2.sftp://$sftp/$ruta_destino_actual/$srcFile", 'rb');
header("Content-Type: application/pdf");
header("Content-Disposition:inline;filename=$srcFile");
fpassthru($stream);
...
?>

Any solution? Thanks!

    
asked by F.Pavese 27.11.2017 в 14:37
source

0 answers