Not to be a tool and reply to my own post, but this is a better patch...
--- secure-files.php-orig Mon Oct 24 03:43:49 2005
+++ secure-files.php Mon Oct 24 03:41:45 2005
@@ -70,7 +70,20 @@
$downloadfile = $sf_directory . basename($downloadfile);
if (is_file($downloadfile)) {
header('Content-Description: File Transfer');
- header('Content-Type: application/force-download');
+
+ if (!extension_loaded('fileinfo')) {
+ if (!dl('fileinfo.' . PHP_SHLIB_SUFFIX)) {
+ header('Content-Type: application/force-download');
+ }
+ }
+
+ if (extension_loaded('fileinfo')) {
+ $res = finfo_open(FILEINFO_MIME);
+ $mime_type = finfo_file($res, $downloadfile);
+ finfo_close($res);
+ header('Content-Type: ' . $mime_type);
+ }
+
header('Content-Length: ' . filesize($downloadfile));
header('Content-Disposition: attachment; filename="' . basename($downloadfile).'"');
@readfile($downloadfile);
@@ -197,4 +210,4 @@
add_action('admin_head', 'sf_admin_head_js');
add_action('template_redirect', 'sf_downloads');
-?>
+?>
Regards,
Pat