summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2006-04-18 23:56:03 +0000
committerxue <>2006-04-18 23:56:03 +0000
commit8882b9e6ee59f9e16e6a8d2ca5f2e765ab201317 (patch)
tree25829125a89660240d63e1930c2e13ad0234e499 /framework/Web
parentf29b8035fc791e7ce61f20461f206cff7d943a71 (diff)
yet another bug fix in sending file.
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/THttpResponse.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 18be9fec..29258259 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -238,15 +238,14 @@ class THttpResponse extends TModule implements ITextWriter
if($mimeType===null)
{
+ $mimeType='text/plain';
if(function_exists('mime_content_type'))
$mimeType=mime_content_type($fileName);
- else
+ else if(($ext=strrchr($fileName,'.'))!==false)
{
- $ext=array_pop(explode('.',$fileName));
+ $ext=substr($ext,1);
if(isset($defaultMimeTypes[$ext]))
$mimeType=$defaultMimeTypes[$ext];
- else
- $mimeType='text/plain';
}
}
$fn=basename($fileName);