Level 104
Not something I use very frequently, but the method signature accepts a $name, which I would expect sets the downloaded file name?
return response()->download($pathToFile, $name, $headers);
2 likes
So, I want the user to download a file with another name than the stored one.
For example:
File is stored as: storage/app/uploaded/7HjQ1Cnhf8zeRrUUMLI9NZtIKyvRDYqNWCIvh8Qm.txt
And I want the user to download this file as file.txt
$path = storage_path('app/'.$file);
???
return response()->download($path);
Someone can help me with that?
Not something I use very frequently, but the method signature accepts a $name, which I would expect sets the downloaded file name?
return response()->download($pathToFile, $name, $headers);
Please or to participate in this conversation.