cb2004 Posted March 5, 2019 Share Posted March 5, 2019 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? Link to comment Share on other sites More sharing options...
Robin S Posted March 5, 2019 Share Posted March 5, 2019 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]); 1 Link to comment Share on other sites More sharing options...
szabesz Posted March 6, 2019 Share Posted March 6, 2019 10 hours ago, Robin S said: 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]); In addition to this – depending on the context where one uses it –, one might need other options too, see: https://processwire.com/api/ref/wire-http/send-file/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now