Qualcuno mi sa dire come devo fare per 'aprire' un documento ? (non scaricare .. ma aprire)

Ho provato con questo .. ma non funcsia !!

Codice PHP:
// ================================================

$len filesize($filename);                                             // -> lunghezza file (percorso + nome)
$filename_nome basename($filename);                                   // -> nome del file
$file_extension strtolower(substr(strrchr($filename_nome,"."),1));    // -> estensione


   //This will set the Content-Type to the appropriate setting for the file

   
switch( $file_extension ) {
     case 
"pdf"$ctype="application/pdf"; break;
     case 
"exe"$ctype="application/octet-stream"; break;
     case 
"zip"$ctype="application/zip"; break;
     case 
"doc"$ctype="application/msword"; break;
     case 
"xls"$ctype="application/vnd.ms-excel"; break;
     case 
"ppt"$ctype="application/vnd.ms-powerpoint"; break;
     case 
"gif"$ctype="image/gif"; break;
     case 
"png"$ctype="image/png"; break;
     case 
"jpeg":
     case 
"jpg"$ctype="image/jpg"; break;
     case 
"mp3"$ctype="audio/mpeg"; break;
     case 
"wav"$ctype="audio/x-wav"; break;
     case 
"mpeg":
     case 
"mpg":
     case 
"mpe"$ctype="video/mpeg"; break;
     case 
"mov"$ctype="video/quicktime"; break;
     case 
"avi"$ctype="video/x-msvideo"; break;
     case 
"txt"$ctype="text/plain"; break;

     
//The following are for extensions that shouldn't be downloaded (sensitive stuff, like php files)
     
case "php":
     case 
"htm":
     case 
"html":die("[b]Cannot be used for "$file_extension ." files![/b]"); break;

  

     default: 
$ctype="application/force-download";

   }

   
header("Content-Type: $ctype");

   
header("Content-Transfer-Encoding: binary");
   
header("Content-Length: ".$len);

   
header("Content-Disposition: attachment; filename=".urlencode($filename_nome));
   
header("Expires: 0");
   
header("Cache-Control: no-cache, must-revalidate");
   
header("Cache-Control: private");
   
header("Pragma: public");

  
   
readfile($filename); 
Grazie mille