Fix for UTF8 filename issues (#12)

This commit is contained in:
Milos Stojanovic
2019-09-05 13:59:20 +02:00
parent 3182ed058a
commit 2ea77cc88e
7 changed files with 69 additions and 13 deletions

View File

@@ -43,10 +43,10 @@ class DownloadController
$this->storage->setPathPrefix($user->getHomeDir());
}
public function download($path_encoded, Request $request, Response $response, StreamedResponse $streamedResponse)
public function download(Request $request, Response $response, StreamedResponse $streamedResponse)
{
try {
$file = $this->storage->readStream((string) base64_decode($path_encoded));
$file = $this->storage->readStream((string) base64_decode($request->input('path')));
} catch (\Exception $e) {
return $response->redirect('/');
}
@@ -67,7 +67,7 @@ class DownloadController
$streamedResponse->headers->set(
'Content-Disposition',
HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $file['filename'])
HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $file['filename'], 'file')
);
$streamedResponse->headers->set(
'Content-Type',
@@ -131,7 +131,8 @@ class DownloadController
'Content-Disposition',
HeaderUtils::makeDisposition(
HeaderUtils::DISPOSITION_ATTACHMENT,
$this->config->get('frontend_config.default_archive_name')
$this->config->get('frontend_config.default_archive_name'),
'archive.zip'
)
);
$streamedResponse->headers->set(