Skip to content

Instantly share code, notes, and snippets.

@diegofelix
Created February 7, 2014 14:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diegofelix/8863402 to your computer and use it in GitHub Desktop.
Save diegofelix/8863402 to your computer and use it in GitHub Desktop.
Laravel 4: Download a string as a file
// return an string as a file to the user
return Response::make($content, '200', array(
'Content-Type' => 'application/octet-stream',
'Content-Disposition' => 'attachment; filename="file-name.ext'
));
@alexkart
Copy link

you missed double quote here:

'attachment; filename="file-name.ext"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment