diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index 16c7aaf9c78..e218ada6d02 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -440,8 +440,14 @@ public function ajax_get_plugin_description($_plugin) { */ public function download($_tmpfname = '') { $tmpfname = $_tmpfname ? $_tmpfname : $_GET['_filename']; - $tmpfname = $GLOBALS['egw_info']['server']['temp_dir'] .'/'. $tmpfname; - if (!is_readable($tmpfname)) die(); + $tmpfname = $GLOBALS['egw_info']['server']['temp_dir'] . DIRECTORY_SEPARATOR . $tmpfname; + + // windows adds ".tmp" file suffix; so check for that too + if (realpath($tmpfname) === FALSE) { + $tmpfname = realpath($tmpfname . ".tmp"); + } + + if ($tmpfname === FALSE || !is_readable($tmpfname)) die(); $appname = $_GET['_appname']; $nicefname = $_GET['filename'] ? $_GET['filename'] : 'egw_export_'.$appname.'-'.date('Y-m-d');