Commit 92b37092408171bd719f6bea98726c76b456ae13
1 parent
86bd9639
Exists in
master
#6610: génération du fichier output à partir de l'input si fichier local
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
server/php/DownloadExport.php
@@ -4,6 +4,7 @@ require_once("RequestManager.php"); | @@ -4,6 +4,7 @@ require_once("RequestManager.php"); | ||
4 | require_once("Constants.php"); | 4 | require_once("Constants.php"); |
5 | 5 | ||
6 | $op_id = $_REQUEST['id']; | 6 | $op_id = $_REQUEST['id']; |
7 | +$file_name = $_REQUEST['filename']; | ||
7 | 8 | ||
8 | if (empty($op_id)) | 9 | if (empty($op_id)) |
9 | { | 10 | { |
@@ -51,7 +52,13 @@ switch($file_info["format"]) | @@ -51,7 +52,13 @@ switch($file_info["format"]) | ||
51 | $file_info["mimetype"] = "text/plain"; | 52 | $file_info["mimetype"] = "text/plain"; |
52 | } | 53 | } |
53 | 54 | ||
54 | -$file_info["name"] = "treps_export_".$op_id.$file_info["extension"]; | 55 | +//set name only if from local browse input mode |
56 | +if($file_name) { | ||
57 | + $file_info["name"] = $file_name.$file_info["extension"]; | ||
58 | +}else { | ||
59 | + $file_info["name"] = "treps_export_".$op_id.$file_info["extension"]; | ||
60 | +} | ||
61 | + | ||
55 | 62 | ||
56 | //make sure the file exists | 63 | //make sure the file exists |
57 | if (!is_file($file_info["path"])) | 64 | if (!is_file($file_info["path"])) |