diff options
author | knut <> | 2007-02-08 11:36:03 +0000 |
---|---|---|
committer | knut <> | 2007-02-08 11:36:03 +0000 |
commit | 628cb5bcb15a6759841e5ce1a95d489ccb00a201 (patch) | |
tree | 765af80ac96b47b21efad23b9472e71f925b9247 | |
parent | 4107da03448e33335e31951217d564b0246c0c6f (diff) |
corrected errors in last checkin (sorry for that)
-rw-r--r-- | framework/Web/THttpResponse.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index bc8f590b..083a5a3e 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -258,10 +258,9 @@ class THttpResponse extends TModule implements ITextWriter * @param string content to be set. If null, the content will be read from the server file pointed to by $fileName.
* @param string mime type of the content.
* @param array list of headers to be sent
- * @param string alternative file name used in attachment disposition
* @throws TInvalidDataValueException if the file cannot be found
*/
- public function writeFile($fileName,$content=null,$mimeType=null,$headers=null,$displayName=null)
+ public function writeFile($fileName,$content=null,$mimeType=null,$headers=null)
{
static $defaultMimeTypes=array(
'css'=>'text/css',
@@ -285,6 +284,7 @@ class THttpResponse extends TModule implements ITextWriter $mimeType=$defaultMimeTypes[$ext];
}
}
+ $fn=basename($fileName);
if(is_array($headers))
{
foreach($headers as $h)
@@ -298,9 +298,6 @@ class THttpResponse extends TModule implements ITextWriter }
header("Content-type: $mimeType");
header('Content-Length: '.($content===null?filesize($fileName):strlen($content)));
- if($displayName === null) {
- $displayName = basename($fileName);
- }
header("Content-Disposition: attachment; filename=\"$displayName\"");
header('Content-Transfer-Encoding: binary');
if($content===null)
|