Show
Ignore:
Timestamp:
12/04/2006 07:18:17 AM (2 years ago)
Author:
xue
Message:

undo 1562. Knut, sorry I have to undo your change because the original code is right and your change will cause BC break.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/framework/Web/THttpResponse.php

    r1562 r1563  
    226226         * @param string mime type of the content. 
    227227         * @param array list of headers to be sent 
    228          * @param string alternative file name used in attachment disposition 
    229228         * @throws TInvalidDataValueException if the file cannot be found 
    230229         */ 
    231         public function writeFile($fileName,$content=null,$mimeType=null,$headers=null,$displayName=null) 
     230        public function writeFile($fileName,$content=null,$mimeType=null,$headers=null) 
    232231        { 
    233232                static $defaultMimeTypes=array( 
     
    253252                        } 
    254253                } 
     254                $fn=basename($fileName); 
    255255                if(is_array($headers)) 
    256256                { 
     
    266266                header("Content-type: $mimeType"); 
    267267                header('Content-Length: '.($content===null?filesize($fileName):strlen($content))); 
    268                 if($displayName === null) { 
    269                   $displayName = basename($fileName); 
    270                 } 
    271                 header("Content-Disposition: attachment; filename=\"$displayName\""); 
     268                header("Content-Disposition: attachment; filename=\"$fn\""); 
    272269                header('Content-Transfer-Encoding: binary'); 
    273270                if($content===null)