We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Laravel Vapor requires custom headers for binary file downloads. https://docs.vapor.build/1.0/projects/development.html#binary-responses
Attempting to do
return (new FastExcel($data))->download('name.xlsx');
will cause an error
Fatal error: Uncaught Exception: Error encoding runtime JSON response: Malformed UTF-8 characters, possibly incorrectly encoded in /var/task/vendor/laravel/vapor-core/src/Runtime/NotifiesLambda.php:49
I see that streamDownload() can take HTTP headers, but there is no way to pass them down from calling download().
streamDownload()
download()
fast-excel/src/Exportable.php
Line 68 in c6d2b8b
Trying to extend the class and customize download method is not viable as many used methods are private.
download
This should work
public function download($path, callable $callback = null) { if (method_exists(response(), 'streamDownload')) { return response()->streamDownload(function () use ($path, $callback) { self::exportOrDownload($path, 'openToBrowser', $callback); }, null, ['X-Vapor-Base64-Encode' => 'True']); } self::exportOrDownload($path, 'openToBrowser', $callback); return ''; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Laravel Vapor requires custom headers for binary file downloads. https://docs.vapor.build/1.0/projects/development.html#binary-responses
Attempting to do
will cause an error
I see that
streamDownload()
can take HTTP headers, but there is no way to pass them down from callingdownload()
.fast-excel/src/Exportable.php
Line 68 in c6d2b8b
Trying to extend the class and customize
download
method is not viable as many used methods are private.This should work
The text was updated successfully, but these errors were encountered: