Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Force download external file
  • Hi every body,
    exist a tip to force download external file in fuelphp?

    Ex : \File::download('http://myserver.com/file/123');

    Because \File::download() just accept a relative path to the DOCROOT.

    Solution  -> Extend the File Class and add a custom method download?
  • If you want it in code, you will fetch the file server side, which you can do with for example a cURL request. You then need to store it temporarily on the server, and then use Fie::download() to offer it to the user.

    There is no ready-made code available to do this. Since it would double the load of your server, normally you would offer the remote link directly to the client.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion