Hello,
    I have to show a file pdf in a browser but its name in the filesystem is something 
like "name_file.file" and the file is word, pdf, gif, etc

I 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);
?>

It doesn't work. But I read that it should work.

    How could do that?

Thanks in advance

Reply via email to