Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UTF-8 filename #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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