Commit c1d7bcd8ca34fdf071e4790be218798538c5ec6c

Authored by Erdogan Furkan
1 parent e32cec67

11287 - Done.

Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
php/downloadPlot.php
... ... @@ -62,7 +62,12 @@ function download_plot($sessionId, $interactiveId, $preview, $preview_function)
62 62 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
63 63 header("Cache-Control: private",false); // required for certain browsers
64 64 header("Content-Type: $ctype");
65   - header("Content-Disposition: attachment; filename=\"".basename($fullPath)."\";" );
  65 + $newName ;
  66 + preg_match('/(\d+)/', basename($fullPath), $matches);
  67 + if (isset($matches[0])) {
  68 + $newName = str_replace('.png', '_'.date('YmdHis').'.png', str_replace($matches[0], (string)$matches[0]+1, basename($fullPath)));
  69 + }
  70 + header("Content-Disposition: attachment; filename=\"".$newName."\";" );
66 71 header("Content-Transfer-Encoding: binary");
67 72 header("Content-Length: ".$fsize);
68 73 ob_clean();
... ...