diff --git a/Classes/Middleware/ImageProcessingMiddleware.php b/Classes/Middleware/ImageProcessingMiddleware.php index d40d51a..fb58869 100644 --- a/Classes/Middleware/ImageProcessingMiddleware.php +++ b/Classes/Middleware/ImageProcessingMiddleware.php @@ -80,9 +80,13 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $mimeType = $processedImage->getMimeType(); $contents = $processedImage->getContents(); + $title = $image->getProperty('title') ?? $image->getNameWithoutExtension(); + $filename = str_replace(' ', '-', strtolower($title)) . '.' . $targetFileExtension; + $response = $this->responseFactory ->createResponse() ->withHeader('Content-Type', $mimeType) + ->withHeader('Content-Disposition', 'inline;filename="' . $filename . '"') ->withHeader('Cache-Control', 'no-cache') ->withHeader('Last-Modified', $lastModified);