Skip to content

Commit

Permalink
adding date to filename
Browse files Browse the repository at this point in the history
when downloading the same file twice, it's not locked
  • Loading branch information
ThaDafinser committed Oct 21, 2015
1 parent 61fd074 commit 252da55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ZfcDatagrid/Renderer/Csv/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function execute()
$optionsExport = $options['settings']['export'];

$path = $optionsExport['path'];
$saveFilename = $this->getCacheId() . '.csv';
$saveFilename = date('Y-m-d_H-i-s') . $this->getCacheId() . '.csv';

$fp = fopen($path . '/' . $saveFilename, 'w');

Expand Down
2 changes: 1 addition & 1 deletion src/ZfcDatagrid/Renderer/PHPExcel/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function execute()
* Save the file
*/
$path = $optionsExport['path'];
$saveFilename = $this->getCacheId() . '.xlsx';
$saveFilename = date('Y-m-d_H-i-s') . $this->getCacheId() . '.xlsx';

$excelWriter = new \PHPExcel_Writer_Excel2007($phpExcel);
$excelWriter->setPreCalculateFormulas(false);
Expand Down
2 changes: 1 addition & 1 deletion src/ZfcDatagrid/Renderer/TCPDF/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function saveAndSend()
$optionsExport = $options['settings']['export'];

$path = $optionsExport['path'];
$saveFilename = $this->getCacheId() . '.pdf';
$saveFilename = date('Y-m-d_H-i-s') . $this->getCacheId() . '.pdf';
$pdf->Output($path . '/' . $saveFilename, 'F');

$response = new ResponseStream();
Expand Down

0 comments on commit 252da55

Please sign in to comment.