summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-11-10 21:36:16 +0000
committerctrlaltca@gmail.com <>2011-11-10 21:36:16 +0000
commit9dec2d59712639c2809975d982c56d1385fdc706 (patch)
tree4a514a62edb6b4b798e30c888a92c97ee4aa1543
parenta4724a9866bda7c0dd0ac40f8efdcdf61e7ab15a (diff)
fix for #275
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/THttpResponse.php4
2 files changed, 4 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 0cc7f208..42010661 100644
--- a/HISTORY
+++ b/HISTORY
@@ -23,6 +23,7 @@ BUG: Issue #240 - TXCache has wrong flush() implementation (ctrlaltca)
BUG: Issue #243 - Cross-site scripting issue in TForm (ctrlaltca)
BUG: Issue #254 - TDbCache should use hash index for the cache key (ctrlaltca)
BUG: Issue #265 - Using scroll wheel causes NaN values in TDatePicker (Gabor)
+BUG: Issue #275 - THttpResponse::writeFile delivers the wrong content type (ctrlaltca)
BUG: Issue #301 - Fixed a bug in TActiveFileUpload (ctrlaltca)
ENH: Issue #337 - Prado serialization optimizations (Gabor)
BUG: Issue #341 - TSafeHtmlParser messes up UTF8-encoded strings (ctrlaltca)
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 9ef55b76..1f0bf6f2 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -385,8 +385,10 @@ class THttpResponse extends TModule implements ITextWriter
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header("Content-Type: $mimeType");
+ $this->_contentTypeHeaderSent = true;
}
- header("Content-type: $mimeType");
+
header('Content-Length: '.$fileSize);
header("Content-Disposition: " . ($forceDownload ? 'attachment' : 'inline') . "; filename=\"$clientFileName\"");
header('Content-Transfer-Encoding: binary');