Skip to content

Commit e1b8620

Browse files
authored
Fix issue loading file from cloud disk (#35)
1 parent e5026f0 commit e1b8620

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Http/Controllers/LoadController.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@
55
namespace DigitalCreative\Filepond\Http\Controllers;
66

77
use DigitalCreative\Filepond\Data\Data;
8+
use Illuminate\Support\Facades\Storage;
89
use Laravel\Nova\Http\Requests\NovaRequest;
9-
use Symfony\Component\HttpFoundation\BinaryFileResponse;
10+
use Symfony\Component\HttpFoundation\StreamedResponse;
1011

1112
class LoadController
1213
{
13-
public function __invoke(NovaRequest $request): BinaryFileResponse
14+
public function __invoke(NovaRequest $request): StreamedResponse
1415
{
1516
$data = Data::fromEncrypted($request->input('serverId'));
1617

17-
return response()->file(
18-
file: $data->absolutePath(),
19-
headers: [
20-
'Content-Disposition' => sprintf('inline; filename="%s"', basename($data->filename)),
21-
],
22-
);
18+
return Storage::disk($data->disk)->response($data->path);
2319
}
2420
}

0 commit comments

Comments
 (0)