laravel / nova-issues

553 stars 34 forks source link

Http response to work with Vapor hosting #1944

Closed matthewhutchings closed 5 years ago

matthewhutchings commented 5 years ago

Description

I have switched over to Vapor and unable to download a file from S3. Download file just shows "Server Error" with no logs.

I suspect Nova this is what is needed

return $response->withHeaders([
    'X-Vapor-Base64-Encode' => 'True',
]);

I do not believe there is a way to attach a Header response to the file download. Could this be fixed to enable downloads?

benjamincrozat commented 5 years ago

Would be great!

jbrooksuk commented 5 years ago

I've not confirmed this, but I believe you could specify the download method on your field:

File::make('File')->download(function ($resource) {
    return Storage::disk('s3')->download('attribute', 'name', [
            'X-Vapor-Base64-Encode' => 'True',
    ])
}),

https://laravel.com/docs/5.8/filesystem#downloading-files