bonjour a tous,

voici le code de mon upload :
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<html>
<head>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post">
Fichier : <input name="fichier" type="file"><br>
<input type="submit" name="upload" value="Uploader">
</form>
<?
if( isset($_POST['upload']) ){
// Taille maximum
$MAX_FILE_SIZE = 150000;
 
// Dossier de destination du fichier
$folder = "./";
 
// Tableau array des différents types
$allowed_types = array("image/bmp", "image/gif", "image/pjpeg", "image/jpeg", "image/jpg", "multipart/x-zip", "video/msvideo");
 
// Variables récupérée par methode POST du formulaires
$fname = $HTTP_POST_FILES['fichier']['name'];
$ftype = $HTTP_POST_FILES['fichier']['type'];
$fsize = $HTTP_POST_FILES['fichier']['size'];
$ftmp = $HTTP_POST_FILES['fichier']['tmp_name'];
 
// Diverses test afin de savoir si :
// Le format de fichier correspond à notre tableau array
if(!in_array($ftype, $allowed_types)){$error = 1;}
 
// La taille du fichier n'est pas dépassée
if($fsize > $MAX_FILE_SIZE){$error = 2;}
 
// Le fichier n'existe pas déjà
if(file_exists($folder."m_".$fname)){$error = 3;}
 
// Si tout va bien, c'est bien déroulé
if(copy($ftmp,''.$folder.''.$fname.'')) {$error = 0;}
 
// Switch servant simplement à la gestion des erreures
switch($error){
case'0':
echo("Fichier correctement envoyé.");
break;
case'1':
echo("Format de fichier incorrecte.");
break;
case'2':
echo("Fichier trop volumineux.");
break;
case'3':
echo("Fichier déjà existant.");
break;
}
echo "<br>" ;
echo ("Le fichier uploadé est :" .$fname) ;
}
?>
 
</body>
</html>
J'aimerai qu'au bout de trois fichiers uploadés, le upload se bloque ou qu'il disparait. Mais je ne sais pas comment faire???

est ce que quelqu'un peut-il m'aider????

merci d'avance

ciao