7 $dir_file =
$dir.$file;
8 $href_dir_file=
dbx()->get_base_url().$dir_file;
10 $ar_ext = explode(
'.',
$file);
11 $ext = strtolower(end($ar_ext));
15 'doc' =>
'application/msword',
16 'docx' =>
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
17 'exe' =>
'application/octet-stream',
20 'html' =>
'text/html',
23 'ldtx' =>
'application/ldtx',
24 'ico' =>
'image/vnd.microsoft.icon',
25 'jpeg' =>
'image/jpg',
28 'pdf' =>
'application/pdf',
30 'ppt' =>
'application/vnd.ms-powerpoint',
32 'swf' =>
'application/x-shockwave-flash',
33 'tif' =>
'image/tiff',
34 'tiff' =>
'image/tiff',
35 'xhtml' =>
'application/xhtml+xml',
36 'xml' =>
'application/xml',
37 'xls' =>
'application/vnd.ms-excel',
38 'xlsx' =>
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
39 'zip' =>
'application/zip'
43 if ($mobile) $ctype=
'application/force-download';
45 if (file_exists($dir_file) && is_readable($dir_file)) {
48 if(ini_get(
'zlib.output_compression')) ini_set(
'zlib.output_compression',
'Off');
50 header(
'Pragma: public');
52 header(
'Cache-Control: must-revalidate, post-check=0, pre-check=0');
53 header(
'Cache-Control: private',
false);
54 header(
'Content-Type: '. $ctype);
55 header(
'Content-Disposition: attachment; filename="'.
$file .
'"');
56 header(
'Content-Transfer-Encoding: binary');
57 header(
'Content-Length: '. filesize($dir_file));
59 $content=
"Desktop: <a href='$href_dir_file'>$file</a>";
62 header(
'Pragma: public');
64 header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
65 header(
"Cache-Control: private",
false);
66 header(
'Content-Type: '. $ctype);
67 header(
'Content-Type: application/octet-stream');
68 header(
"Content-Disposition: attachment; filename=\"{$file}\";" );
69 header(
'Content-Transfer-Encoding: binary');
70 header(
'Content-Length: '. filesize(
$dir.$file));
73 $content=
"Mobile: <a href='$href_dir_file'>$file</a>";
78 $content.=
"<h1>File Not Found:</h1><br>($dir_file)<br> href=($href_dir_file)";