ugrás a tartalomhoz

IE és a download

toxin · 2006. Jún. 2. (P), 12.20
kérdés adott akarmi fájlt kiszolgálok egy ilyen kódal
  1. <?php  
  2. function get_content_type($extension)  
  3. {  
  4.     switch (strtolower($extension))  
  5.     {  
  6.         case 'txt':  return 'text/plain';  
  7.         case 'com':  return 'application/x-msdownload';  
  8.         case 'pdf':  return 'application/pdf';  
  9.         case 'html'return 'text/html';  
  10.         case 'gif':  return 'image/gif';  
  11.         case 'jpg':  return 'image/jpeg';  
  12.         case 'png':  return 'image/png';  
  13.         case 'zip':  return 'application/x-zip-compressed';  
  14.         case 'rar':  return 'application/x-rar-compressed';  
  15.         case 'gz':   return 'application/x-gzip';  
  16.         case 'tar':  return 'application/x-tar';  
  17.     }  
  18.     return 'unknown';  
  19. }  
  20.   
  21.   
  22.   
  23. if (isset($_GET['download']))  
  24. {  
  25.     $file = pathinfo($_GET['download']);  
  26.     header('Content-Type: ' . get_content_type($file['extension']));  
  27.     header('Content-Disposition: Attachment; filename="' .$file['basename']. '"');  
  28.     readfile($root_path.'usr/templates/'.$_GET['download']);  
  29.     exit();  
  30. }  
  31. ?>  
magyarán felhozza az open/download ablakot, adott fájlra, namost fx alatt nincs is gáz, de IE alatt a kiküldött session_start ill. no-cache header miatt nem fér hozzá az open gomb megnyomásával leszedett cuccoshoz ( a gyorstárból kéne, de ott nem jön létre az előbbiek miatt), ergo nem tudja megnyitni

kiadva a ini_set("session.cache_limiter","private"); -t persze igen, de ekkor admin oldal ill. egyébb generált tartalom nem frissül

kis helpet, pls thx :)