Ciao, se puo tornarti utlile io ho usato questo per un sito.
codice:
<?php
// place this code inside a php file and call it f.e. "download.php"
$path = "dload/"; //cartella dove sta il file da scaricare
$name='Parto_Per_La_Luna.mp3';
$fullPath = $path.$name;
if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
switch ($ext) {
case "mp3":
header("Content-type: application/mp3"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
break;
default;
header("Content-type: application/octet-stream");
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
?>
Chiamando lo script da url su click da link come ho fatto parte direttamente il dload (apri/salva)
Non ho provato per .zip