From 3ff35ae583c52e54418a61cabf3282c00a8039d1 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 18 Apr 2006 23:29:18 +0000 Subject: Merge from 3.0 branch till 942. --- framework/Web/THttpResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'framework/Web/THttpResponse.php') 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) -- cgit v1.2.3