diff --git a/php/downloadPlot.php b/php/downloadPlot.php index 7921f5b..df07905 100644 --- a/php/downloadPlot.php +++ b/php/downloadPlot.php @@ -62,7 +62,12 @@ function download_plot($sessionId, $interactiveId, $preview, $preview_function) header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: $ctype"); - header("Content-Disposition: attachment; filename=\"".basename($fullPath)."\";" ); + $newName ; + preg_match('/(\d+)/', basename($fullPath), $matches); + if (isset($matches[0])) { + $newName = str_replace('.png', '_'.date('YmdHis').'.png', str_replace($matches[0], (string)$matches[0]+1, basename($fullPath))); + } + header("Content-Disposition: attachment; filename=\"".$newName."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$fsize); ob_clean(); -- libgit2 0.21.2