Hi,
I am trying to show a file in a browser. The file could be binary (pdf, word, etc) and the file could be in my server or in another server.
I have tried to do
<?
$url = 'http://domain.org/path/to/file/';
$file = "name_file.file";
header('Content-Type: application/x');
header('Content-Disposition: attachment; filename=' . $file ) ;
header("Content-Transfer-Encoding: binary");
$size = filesize($url . $file);
header('Content-length: ' . $size ) ;
@readfile($url . $file);
?>
What' is the problem?
I have tried to do it in my server using a phisical route.