I am storing files for a site on Rackspace using Flysystem. Uploading is no problem, having trouble figuring out how to start a download for a file - this is what I have tried
Storage::disk('rackspace');
return response()->download('file-library/' . $file->filename);
The result is that the file could not be found. Is adding Storage::disk()
sufficient for making Laravel look in this location rather than locally? What is the best way to accomplish this?
Frank here from Flysystem.
The preferred way to do this would be to use the readStream output in combination with Response::stream.
The
$fs
is theLeague\Flysystem\Filesystem
instance. I believe there is a method to retrieve this instance in the filesystem class Laravel provides.No, that wouldn't affect
response()->download()
calls.Something like this should work: