| version 1.6, 2003/02/04 21:46:04 |
version 1.7, 2003/07/24 23:08:36 |
|
|
| * Tony J. White, tjw@tjw.org, 2002-04-15 |
* Tony J. White, tjw@tjw.org, 2002-04-15 |
| **************************************************************************/ |
**************************************************************************/ |
| |
|
| /* $Platon: phpWebFileManager/plugins/file.php,v 1.5 2002/10/16 21:19:22 nepto Exp $ */ |
/* $Platon: phpWebFileManager/plugins/file.php,v 1.6 2003/02/04 21:46:04 nepto Exp $ */ |
| |
|
| /* |
/* |
| * phpWebFileManager initialization |
* phpWebFileManager initialization |
| Line 152 function fm_main() |
|
| Line 152 function fm_main() |
|
| * Writting file on output |
* Writting file on output |
| */ |
*/ |
| |
|
| header('Content-length: '.filesize($file)); |
|
| if (preg_match('/.*\.([a-z]{2,5})$/i', $file, $matches) |
if (preg_match('/.*\.([a-z]{2,5})$/i', $file, $matches) |
| && trim($mimes_by_ext[$matches[1]]) != '') { |
&& trim($mimes_by_ext[$matches[1]]) != '') { |
| header('Content-type: '.trim($mimes_by_ext[$matches[1]])); |
header('Content-Type: '.trim($mimes_by_ext[$matches[1]])); |
| } else { |
} else { |
| header('Content-type: text/plain'); |
header('Content-Type: text/plain'); |
| } |
} |
| |
header('Content-Length: '.filesize($file)); |
| |
header('Content-Disposition: attachment; filename="'.basename($file).'"'); |
| |
|
| @readfile($file); |
@readfile($file); |
| return true; |
return true; |