Jump to content

Recommended Posts

Posted

So I have this working using:

$session->redirect($page->file->url);

However I tried using $http->sendfile and $files->send as I thought they would be better but they didn't work. Any thoughts?

Posted
8 hours ago, cb2004 said:

However I tried using $http->sendfile and $files->send as I thought they would be better but they didn't work.

Both of these are the same and they work like this:

$files->send($page->file->filename);

And you can force the download for file types that might otherwise open in the browser like this:

$files->send($page->file->filename, ['forceDownload' => true]);

 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...