Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Download using header
  • Hi, I retrieved a script to export my database to excel. the excel however is downloaded using the header
    header("Content-type: application/octet-stream");
        header("Content-Disposition: attachment; filename=reports.xls");
        header("Pragma: no-cache");
        header("Expires: 0");
        print "$header\n$data";
    

    When I try and redirect him to a page, the download isn't done.
    How can this be fixed? Im using RC2. Kind regards
  • I can suggest you to upgrade to RC3 and use File::download()
  • Okay, sill try and do that. But where can I find the documentation on the download() function?
    Doesn't seem to be in the file docs...
  • You can find this function in fuel/docs on Github ( develop branch ) :
    https://github.com/fuel/docs/tree/develop
  • peter vercauteren wrote on Wednesday 27th of July 2011:
    Okay, sill try and do that. But where can I find the documentation on the download() function?
    Doesn't seem to be in the file docs...

    http://fuelphp.com/dev-docs/classes/file/usage.html /\ development branch docs, you might need to update your core from the Develop branch on git.
  • Aah okay, thx :)

Howdy, Stranger!

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

In this Discussion