| @@ -38,8 +38,13 @@ | ||
| 38 | 38 | */ |
| 39 | 39 | protected $storage; |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | + * @var | |
| 43 | + */ | |
| 44 | + protected $separator; | |
| 45 | + | |
| 46 | + /** | |
| 42 | 47 | * @param Config $config |
| 43 | 48 | * @param AuthInterface $auth |
| 44 | 49 | * @param Filesystem $storage |
| 45 | 50 | */ |
| @@ -51,8 +56,10 @@ | ||
| 51 | 56 | $this->user = $this->auth->user() ?: $this->auth->getGuest(); |
| 52 | 57 | |
| 53 | 58 | $this->storage = $storage; |
| 54 | 59 | $this->storage->setPathPrefix($this->user->getHomeDir()); |
| 60 | + | |
| 61 | + $this->separator = $this->storage->getSeparator(); | |
| 55 | 62 | } |
| 56 | 63 | |
| 57 | 64 | /** |
| 58 | 65 | * @param Request $request |
| @@ -204,8 +211,10 @@ | ||
| 204 | 211 | { |
| 205 | 212 | |
| 206 | 213 | |
| 207 | 214 | $uniqid = (string) preg_replace('/[^0-9a-zA-Z_]/', '', (string) $request->input('uniqid')); |
| 215 | + $name = $request->input('name', $this->config->get('file.default_archive_name')); | |
| 216 | + | |
| 208 | 217 | $file = $tmpfs->readStream($uniqid); |
| 209 | 218 | |
| 210 | 219 | $streamedResponse->setCallback(function () use ($file, $tmpfs, $uniqid) { |
| 211 | 220 | // @codeCoverageIgnoreStart |
| @@ -225,10 +234,10 @@ | ||
| 225 | 234 | $streamedResponse->headers->set( |
| 226 | 235 | 'Content-Disposition', |
| 227 | 236 | HeaderUtils::makeDisposition( |
| 228 | 237 | HeaderUtils::DISPOSITION_ATTACHMENT, |
| 229 | - $this->config->get('file.default_archive_name'), | |
| 230 | - 'archive.zip' | |
| 238 | + $name, | |
| 239 | + $this->config->get('file.default_archive_name') | |
| 231 | 240 | ) |
| 232 | 241 | ); |
| 233 | 242 | $streamedResponse->headers->set( |
| 234 | 243 | 'Content-Type', |