".$riga["nome"]."
";?> 'application/octet-stream', 'html' => 'text/html', 'doc' => 'application/msword', 'pdf' => 'application/pdf', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'txt' => 'text/plain', ); $bytes = filesize($file); $info = pathinfo($file); $ext = strtolower($info['type']); $type = isset($mimeTypes[$ext]) ? $mimeTypes[$ext] : 'application/octet-stream'; header('Content-Transfer-Encoding: binary'); header("Content-Type: {$mt}"); header("Content-disposition: attachment; filename={$info['appunto']}.{$info['type']}"); header("Content-length: {$bytes}"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); readfile($file); } if (isset($_GET['file'])) { try { download($_GET['file']); } catch (Exception $e) { die($e->getMessage()); } } ?>