Cant download xlsx in vapor through Export action
Currently CSV files are downloading fine but XLSX are throwing {"message":"Internal Server Error"} in Vapor
6 Replies
Did you ever solve this? Having the same issue
it seems to work locally (using minio to store files)
I could narrow it down to
Filament\Actions\Exports\Downloaders\XlsxDownloader
the issue seems to be
the download method is having issues with the lambda runtime. I would guess this is what I am talking about:
https://docs.vapor.build/projects/development.html#binary-responses
if I delete the file, the streamed response kicks in (building the file inside the stream from the CSV data), which works just fine. Unfortunately there doesnt seem to be a way to keep the xlsx download button but disable its generation (I wouldnt even call this correct)Development | Laravel Vapor
Laravel at Infinite Scale
@Stefano Were you ever able to solve this? I am having the same issue. XLSX works perfectly in local development, throws an error in Vapor. I get a 502 Bad Gateway error when trying to download the document
unfortunately no, I had to settle for the .csv format...
if I had to go any further I would've tried to hook myself somewhere and add the X-Vapor-Base64-Encode header to true, but I did not see any obvious way to do so at the time
Appreciate the response. I'm sticking with CSV as well
@bwurtz999 @Stefano
Thanks for the investigation here. I was able to get this to work , but maybe not in the cleanest way but I can live with it to have the functionality.
1. Make a derivative copy of XlsxDownloader to my App namespace
I copied \Filament\Actions\Exports\Downloaders\XlsxDownloader.php to App\Filament\Actions\Exports\Downloaders\XlsxDownloader.php
2. Setup AppServiceProvider Bindings
3. Set the header on the download call from the storage disk