Revize c1bdc1c4
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
application/helpers/download.php | ||
---|---|---|
}
|
||
|
||
$mime = 'application/octet-stream';
|
||
|
||
if (text::ends_with(mb_strtolower($filename), '.jpg') ||
|
||
text::ends_with(mb_strtolower($filename), '.jpeg'))
|
||
{
|
||
$mine = 'image/jpeg';
|
||
}
|
||
else if (text::ends_with(mb_strtolower($filename), '.png'))
|
||
{
|
||
$mine = 'image/png';
|
||
}
|
||
else if (text::ends_with(mb_strtolower($filename), '.gif'))
|
||
{
|
||
$mine = 'image/gif';
|
||
}
|
||
|
||
// Generate the server headers
|
||
@header('Content-Description: File Transfer');
|
||
@header('Content-Type: '.$mime);
|
||
@header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||
@header('Content-Transfer-Encoding: binary');
|
Také k dispozici: Unified diff
Release 1.1.0