Tengo lo siguiente:
Código PHP:
...</head>
<body>
<?php
if(!empty($_GET['id']) && $_GET['a']=="down" && !empty($_GET['photo'])){
$root = "images/album/".$_GET['id']."/";
$file = basename($_GET['photo']);
$path = $root.$file;
$type = '';
$size = filesize($path);
if (function_exists('mime_content_type')) {
$type = mime_content_type($path);
} else if (function_exists('finfo_file')) {
$info = finfo_open(FILEINFO_MIME);
$type = finfo_file($info, $path);
finfo_close($info);
}
if ($type == ''){
$type = "application/force-download";
}
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"$file\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$size);
readfile($path);
mysql_close();
redirect("galeria.php?id=".$_GET['id']);
exit;
}
?>
<div id="page" align="center">...
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php:23) in /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php on line 45
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php:23) in /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php:23) in /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php on line 47
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php:23) in /Applications/XAMPP/xamppfiles/htdocs/22_shiva/galeria.php on line 48
�����JFIF��������C� ���C ��������
Alguien me puede ayudar :<
Muchas gracias!