Index: filemanager/index.php =================================================================== RCS file: /cvsroot/phpgroupware/filemanager/index.php,v retrieving revision 1.30.2.9.2.4 diff -u -r1.30.2.9.2.4 index.php --- filemanager/index.php 9 Sep 2003 06:42:08 -0000 1.30.2.9.2.4 +++ filemanager/index.php 20 Nov 2003 09:50:41 -0000 @@ -437,6 +437,13 @@ if ($download) { + /* This is very bad if there is a lot's of files, but I have no idea how to deal in another way (BH) */ + $lt_tmp = array(); + foreach ($ls_array as $arr) + { + $ls_tmp[$arr['name']] = $arr; + } + unset ($arr); for ($i = 0; $i != $numoffiles; $i++) { if (!$fileman[$i]) @@ -445,8 +452,9 @@ } $download_browser = CreateObject ('phpgwapi.browser'); - $download_browser->content_header ($fileman[$i]); + $download_browser->content_header ($fileman[$i],'',$ls_tmp[$fileman[$i]]['size']); echo $GLOBALS['phpgw']->vfs->read (array ('string' => $fileman[$i])); + unset($ls_tmp); $GLOBALS['phpgw']->common->phpgw_exit (); } } @@ -460,7 +468,6 @@ 'nofiles' => True ) ); - if ($ls_array[0]['mime_type']) { $mime_type = $ls_array[0]['mime_type']; @@ -470,7 +477,8 @@ $mime_type = 'text/plain'; } - header('Content-type: ' . $mime_type); + $download_browser = CreateObject ('phpgwapi.browser'); + $download_browser->content_header ($file,$mime_type,$ls_array[0]['size']); echo $GLOBALS['phpgw']->vfs->read (array ( 'string' => $path.'/'.$file, 'relatives' => array (RELATIVE_NONE)