Add filename param support with Content-Disposition header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6c82523cc8
commit
3ade5bca9e
1 changed files with 2 additions and 0 deletions
|
|
@ -60,7 +60,9 @@ class GenerateController
|
|||
}
|
||||
|
||||
// Retourner le PDF
|
||||
$filename = !empty($data['filename']) ? basename($data['filename']) : 'document.pdf';
|
||||
header('Content-Type: application/pdf');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
header('Content-Length: ' . strlen($pdf));
|
||||
echo $pdf;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue