Changeset 1563 for branches/3.0
- Timestamp:
- 12/04/2006 07:18:17 AM (2 years ago)
- Files:
-
- 1 modified
-
branches/3.0/framework/Web/THttpResponse.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/framework/Web/THttpResponse.php
r1562 r1563 226 226 * @param string mime type of the content. 227 227 * @param array list of headers to be sent 228 * @param string alternative file name used in attachment disposition229 228 * @throws TInvalidDataValueException if the file cannot be found 230 229 */ 231 public function writeFile($fileName,$content=null,$mimeType=null,$headers=null ,$displayName=null)230 public function writeFile($fileName,$content=null,$mimeType=null,$headers=null) 232 231 { 233 232 static $defaultMimeTypes=array( … … 253 252 } 254 253 } 254 $fn=basename($fileName); 255 255 if(is_array($headers)) 256 256 { … … 266 266 header("Content-type: $mimeType"); 267 267 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\""); 272 269 header('Content-Transfer-Encoding: binary'); 273 270 if($content===null)
