Bonjour,

je télécharge un fichier avec le code suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php 
$nom_file=$_GET['nom_file'];
// code pour forcer un téléchargement
 
$nom_file=basename($_GET['nom_file']);
$full_path=dirname(__FILE__).'/../sauvegarder/archive/'.$nom_file;
$file_name = basename($full_path);
 
ini_set('zlib.output_compression', 0);
$date = gmdate(DATE_RFC1123);
 
header('Pragma: public');
header('Cache-Control: must-revalidate, pre-check=0, post-check=0, max-age=0');
 
header('Content-Tranfer-Encoding: none');
header('Content-Length: '.filesize($full_path));
header('Content-MD5: '.base64_encode(md5_file($full_path)));
header('Content-Type: application/octetstream; name="'.$file_name.'"');
header('Content-Disposition: attachment; filename="'.$file_name.'"');
 
header('Date: '.$date);
header('Expires: '.gmdate(DATE_RFC1123, time()+1));
header('Last-Modified: '.gmdate(DATE_RFC1123, filemtime($full_path)));
 
readfile($full_path);
exit; // nécessaire pour être certain de ne pas envoyer de fichier corrompu
?>
Et il me propose de sauvegarder un fichier de type archive, et si j'accepte, j'obtiens un fichier avec l'extension .wga.zip ; or je voudrais juste .wga et c'est le cas, si je remplace l'option "de type archive" par "tous les fichiers". Que faire pour que ce soit automatique ?