Skip to content

Conversation

Nationalcat
Copy link

@Nationalcat Nationalcat commented Feb 6, 2020

Using Laravel response()->download() to append filename*=utf-8 to Content Disposition header when filename has UTF-8 encode.

@barryvdh
Copy link
Owner

barryvdh commented Feb 8, 2020

Not really sure, this saves the file on disk?

@Nationalcat
Copy link
Author

Yes, this saved it on disk. But it will delete after the response.
Or change that

$encodeFilename = rawurlencode($filename);
...
'Content-Disposition' => "attachment; filename=\"$filename\"; filename*=utf-8''{$encodeFilename}",

This plan is not use Symfony\Component\HttpFoundation\BinaryFileResponse, but is work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants