0

I only know to do this using headers such as below example.

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($zip_file));
header('Content-Length: ' . filesize($zip_file));

Is there a framework that does this better? I been looking at the https://packagist.org but couldnt find anything.

LukeDS
  • 141
  • 8
  • 1
    Well, you can tell PHP to zip a folder and serve it back to the client? Its even possible to stream .zip files to the client while its zipping. You can also take a look at this answer to force downloads from a link: https://stackoverflow.com/questions/21088376/how-to-force-fully-download-txt-file-on-link – keanu_reeves Jul 31 '19 at 20:26
  • 1
    https://github.com/artdarek/force-download – Code Spirit Jul 31 '19 at 22:18

0 Answers0