Skip to content

Commit

Permalink
Ensure the file name is sent for bulky items (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar authored Nov 27, 2024
1 parent d3dccef commit e9b1f92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Controller/DownloadBulkyItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Terminal42\NotificationCenterBundle\Controller;

use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
Expand Down Expand Up @@ -44,6 +45,10 @@ static function () use ($stream): void {

$response->headers->set('Content-Type', 'application/octet-stream');
$response->headers->set('Cache-Control', 'no-cache, no-store, must-revalidate');
$response->headers->set('Content-Disposition', HeaderUtils::makeDisposition(
HeaderUtils::DISPOSITION_ATTACHMENT,
$bulkyItem->getName(),
));

return $response;
}
Expand Down

0 comments on commit e9b1f92

Please sign in to comment.