diff --git a/server/php/DownloadExport.php b/server/php/DownloadExport.php index 2f5f698..fcde6ed 100644 --- a/server/php/DownloadExport.php +++ b/server/php/DownloadExport.php @@ -4,6 +4,7 @@ require_once("RequestManager.php"); require_once("Constants.php"); $op_id = $_REQUEST['id']; +$file_name = $_REQUEST['filename']; if (empty($op_id)) { @@ -51,7 +52,13 @@ switch($file_info["format"]) $file_info["mimetype"] = "text/plain"; } -$file_info["name"] = "treps_export_".$op_id.$file_info["extension"]; +//set name only if from local browse input mode +if($file_name) { + $file_info["name"] = $file_name.$file_info["extension"]; +}else { + $file_info["name"] = "treps_export_".$op_id.$file_info["extension"]; +} + //make sure the file exists if (!is_file($file_info["path"])) -- libgit2 0.21.2