Skip to content

Commit

Permalink
Merge pull request #5 from MLDMoritz/patch-1
Browse files Browse the repository at this point in the history
Add filename fallback for download
  • Loading branch information
n1crack authored Jul 27, 2023
2 parents 018fabc + 19be7f1 commit 051d5e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/VueFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,15 @@ public function download()
$path = $this->request->get('path');
$response = $this->streamFile($path);

$filenameFallback = preg_replace(
'#^.*\.#',
md5($path) . '.', $path
);

$disposition = $response->headers->makeDisposition(
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
basename($path)
basename($path),
$filenameFallback
);
$response->headers->set('Content-Disposition', $disposition);

Expand Down

0 comments on commit 051d5e8

Please sign in to comment.