1

I have uploaded a file using Laravel s3 driver configured for Digital Ocean space. Now I want to download the file using an api request. The code for the download is:

return \response()->download(Storage::disk('do')->url($user->cv), $user->name);

It gives me an error response saying

The file "https://lms3.fra1.digitaloceanspaces.com/answers/3/ygcFuQfmVgdcxWRteE3hTlF0CuntsycSQmuDystT.pdf"

But the file actually exists and you can check this link. What is wrong with this code?

Yeasir Arafat
  • 1,425
  • 1
  • 13
  • 28
  • If I had to guess without seeing much code, I would think it's due to permissions not being set properly. Also, you don't need a `\ ` before `response()`, since `response()` is a global function. – Brian Logan Dec 20 '20 at 08:57

1 Answers1

0

I have the same problem and I just found a (shitty) workaround. Or at least a way to get Laravel to find the file.

php artisan cache:clear

Gordon Freeman
  • 3,260
  • 1
  • 22
  • 42