VaporFile Download Redirect #5604
-
VaporFile is meant to handle file uploads >6MB. However, by default, when downloading the file you pipe the stream through Vapor even though Lambda / Vapor can only handle files < 6MB. I'd like to propose changing the default download callback to return a redirect to a temporary URL. This has the added benefit that if the file is binary you don't have to set a custom header https://docs.vapor.build/1.0/projects/development.html#binary-responses |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Shouldn't you be able to do the following? use Illuminate\Support\Facades\Storage;
use Laravel\Nova\Fields\VaporImage;
VaporImage::make('Photo', 'photo')
->download(function ($request, $model, $disk, $value) {
return redirect(Storage::disk($disk)->temporaryUrl(
$value, now()->addMinutes(5)
));
}), |
Beta Was this translation helpful? Give feedback.
-
@crynobone |
Beta Was this translation helpful? Give feedback.
This has been added to our documentation: https://nova.laravel.com/docs/4.0/resources/file-fields.html#downloading-large-files-with-temporary-urls