ho aggiunto readfile() ma quando apro il file mi dice che è danneggiato.
questo è il codice aggiornato
Codice PHP:
$filen='xp2.jpg';
$filen2='capture.wav';
$path='cart/';
$perc_comp=$path.$filen;
$perc_comp2=$path.$filen2;
$base=basename($perc_comp);
$base2=basename($perc_comp2);
$dim=filesize($perc_comp);
$dim2=filesize($perc_comp2);
//header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename='.$base);
header("Content-Type: application/octet-stream");
//header("Content-Type: application/download");
header("Content-Description: File Transfer");
header('Content-Transfer-Encoding: binary');
header("Content-Length: ".$dim);
readfile($perc_comp);