Browse Source

Force the filename (with a .csv extension) when downloading the audit errors as a CSV file.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4294 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 9 years ago
parent
commit
91733fbd6f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      pages/audit.php

+ 3 - 0
pages/audit.php

@@ -197,6 +197,9 @@ try
 			}
 			else
 			{
+				$sCSVName = basename($sFileName); // pseudo sanitization, just in case
+				// Force the name of the downloaded file, since windows gives precedence to the extension over of the mime type
+				$oP->add_header("Content-disposition: attachment; filename=\"$sCSVName\"");
 				$oP->add_header("Content-type: text/csv; charset=$sCharset");
 			}
 			$oP->add($sOutputData);