2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @author Raj Kissu Rajandran
6 * @package BLOBStreaming
11 $filename = isset($_REQUEST['file_path']) ?
$_REQUEST['file_path'] : NULL;
12 $c_type = isset($_REQUEST['c_type']) ?
$_REQUEST['c_type'] : NULL;
14 if (isset($filename) && isset($c_type))
16 $hdrs = get_headers($filename, 1);
19 $f_size = $hdrs['Content-Length'];
22 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
23 header("Cache-Control: no-store, no-cache, must-revalidate");
24 header("Cache-Control: post-check=0, pre-check=0", false);
25 header("Pragma: no-cache");
26 header("Content-type: $c_type");
27 header('Content-length: ' . $f_size);
28 header("Content-disposition: attachment; filename=" . basename($filename));
30 $fHnd = fopen($filename, "rb");
39 $content .= fread($fHnd, $f_size);
40 $pos = strlen($content);