Download file at specific local folder Is it possible to download a file from the web server at a local folder?
https://laravel-news.com/http-sink
This will download the file from $url and put it on local $path in streaming mode, not loading full file to memory:
$url = 'https://example.com/example-file.zip';
$path = 'folder/download.zip';
Http::sink(Storage::path($path))->get($url);
@Glukinho
Is sink method available in Laravel 11?
@Glukinho
Correct me if I am wrong: the location in my computer where the downloaded files will be stored, can be defined in the settings of the browser I use. i,e, for Firefoz you have to go to Settings.
@adamnet do you need to download file to Laravel storage (a directory on a server) or to user's computer? I assumed first.
If you need to download file to user's computer, then why you need Laravel? Just give user an URL and he will download using his browser.
What, where from and where to do you want to download?
Please sign in or create an account to participate in this conversation.