Support the ongoing development of Laravel.io →
Requests Views
Last updated 2 years ago.
0

Yes, you are missing something. The Response::download() first argument is $filePath, i.e a path to an existing file. I'm suspecting that what you pass does not yet exist.

Like DrPrez says, you would have to first create that file. You could use the File::put($filePath, $content); first.

If there is no need for you to store the file on your server, you could return a view or a simple variable as a octet-stream (download). There is many ways to do that and I'm sure you'll find it with Google.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

montes2012 montes2012 Joined 11 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.