diff options
author | xue <> | 2006-04-18 23:28:23 +0000 |
---|---|---|
committer | xue <> | 2006-04-18 23:28:23 +0000 |
commit | f29b8035fc791e7ce61f20461f206cff7d943a71 (patch) | |
tree | b29dadabb7f96c84c4d7050d9e180b51ba38ac0c /framework/Web | |
parent | 4a4d7d8979801e75f0d339e1c10ba9360d279eec (diff) |
Fixed a bug in calculating file size.
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/THttpResponse.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index ee2dd99b..18be9fec 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -254,7 +254,7 @@ class THttpResponse extends TModule implements ITextWriter header('Expires: 0');
header('Cache-Component: must-revalidate, post-check=0, pre-check=0');
header("Content-type: $mimeType");
- header('Content-Length: '.filesize($fileName));
+ header('Content-Length: '.($content===null?filesize($fileName):strlen($content)));
header("Content-Disposition: attachment; filename=\"$fn\"");
header('Content-Transfer-Encoding: binary');
if($content===null)
|