Author Topic: better header for file send function  (Read 4785 times)

jonass

  • Beginner
  • *
  • Posts: 1
better header for file send function
« on: May 30, 2006, 15:35:44 pm »
Hi

This header works better for us as we had problem with product_sheet files in IE
Its a modified version of the send_file function in file ps_product_files.php
This header is based on the one used in Docman

$fsize = filesize($dbf->f("file_name"));
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: inline;'
. ' filename="' . basename($dbf->f("file_name")) . '";'
. ' size=' . $fsize .';'
);
header("Content-Type: "    . $dbf->f("file_mimetype") );         
header("Content-Length: "  . $fsize);

/Jonas
www.kodamera.se

mgrick

  • Beginner
  • *
  • Posts: 8
Re: better header for file send function
« Reply #1 on: November 04, 2006, 21:20:45 pm »
Currently we have large downloads in our store (150mb FLV's) and it seems the PHP security is set to max 25mb for open scripts. Our downloads terminate around 18 to 20mb as a result. But using Docman they are fine. I am told this is due to one method (native VM downloads) uses PHP and the other (Docman) uses a different method.

Is this header hack a possible solution to this?

Thanks!

nuttyproducer

  • Beginner
  • *
  • Posts: 3
Re: better header for file send function
« Reply #2 on: November 19, 2011, 23:19:33 pm »
i have the same nasty problem man :s don't know a solution :(