diff options
author | xue <> | 2006-04-18 23:56:03 +0000 |
---|---|---|
committer | xue <> | 2006-04-18 23:56:03 +0000 |
commit | 8882b9e6ee59f9e16e6a8d2ca5f2e765ab201317 (patch) | |
tree | 25829125a89660240d63e1930c2e13ad0234e499 /framework | |
parent | f29b8035fc791e7ce61f20461f206cff7d943a71 (diff) |
yet another bug fix in sending file.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/THttpResponse.php | 7 |
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);
|