Skip to content

Commit

Permalink
IBX-3036: Provided fallback for Content-Disposition header in `Downlo…
Browse files Browse the repository at this point in the history
…adController`

For more details see https://issues.ibexa.co/browse/IBX-3036 and #320
  • Loading branch information
barw4 authored Jul 7, 2022
1 parent b440a5f commit c744542
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public function downloadBinaryFileAction($contentId, $fieldIdentifier, $filename
}

$response = new BinaryStreamResponse($this->ioService->loadBinaryFile($field->value->id), $this->ioService);
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename);
$response->setContentDisposition(
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
$filename,
bin2hex(random_bytes(8))
);

return $response;
}
Expand Down

0 comments on commit c744542

Please sign in to comment.