Changeset 1562
- Timestamp:
- 12/04/2006 07:00:52 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
r1508 r1562 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 disposition 228 229 * @throws TInvalidDataValueException if the file cannot be found 229 230 */ 230 public function writeFile($fileName,$content=null,$mimeType=null,$headers=null )231 public function writeFile($fileName,$content=null,$mimeType=null,$headers=null,$displayName=null) 231 232 { 232 233 static $defaultMimeTypes=array( … … 252 253 } 253 254 } 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 header("Content-Disposition: attachment; filename=\"$fn\""); 268 if($displayName === null) { 269 $displayName = basename($fileName); 270 } 271 header("Content-Disposition: attachment; filename=\"$displayName\""); 269 272 header('Content-Transfer-Encoding: binary'); 270 273 if($content===null)
