[SOLVED] Sc_redir open file.pdf

when i open a file pdf with sc_redir i.e.
sc_redir(’…/…/…/file/doc/file.pdf’,’ ‘,’_blank’);
the brower show in address bar
http://127.0.0.1:8091/scriptcase/file/doc/53-0128425.pdf

do you know any other way to hide the file name and path?

TKS

Create a blank application and do something like this:

<?php 
  
// Store the file name into variable 
$file = 'filename.pdf'; 
$filename = 'filename.pdf'; 
  
// Header content type 
header('Content-type: application/pdf'); 
  
header('Content-Disposition: inline; filename="' . $filename . '"'); 
  
header('Content-Transfer-Encoding: binary'); 
  
header('Accept-Ranges: bytes'); 
  
// Read the file 
@readfile($file); 
  
?> 

https://www.geeksforgeeks.org/how-to-open-a-pdf-files-in-web-browser-using-php/

1 Like

It’s Perfect
TKS a lot