bonjour,jai un soucis pour uploader des videos.Mon code permet lupload d'images sans problèmes mais je n'arrive pas a uploader mes videos. Comment faire ?
Voici mon code dupload ainsi que le code pour linterface dupload :
interface :
et lupload :
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 <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"> <!-- body { background-color: #EBEBEB; } .style6 {font-size: 11px; color: #333333; font-family: Arial, Helvetica, sans-serif; } .style7 {font-size: 14px; color: #333333; font-family: Arial, Helvetica, sans-serif; } --> </style> <SCRIPT language="JavaScript"> <!-- function ControleVide() { if(document.Formulaire.Nom.value=='') { alert('Le champ titre ne peut rester vide'); document.Formulaire.Nom.focus(); } else { document.Formulaire.method = "POST"; document.Formulaire.action = "fichier.php"; document.Formulaire.submit(); } } //--> </script> <title></title></head> <body> <table width="600" border="1" align="center" cellpadding="0" cellspacing="10" bordercolor="#CCCCCC" bgcolor="#FFFFFF"> <tr> <td bordercolor="#FFFFFF"><p align="center"> </p> <table width="300" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#EDECFF"> <tr> <td bordercolor="#E8E8E8" bgcolor="#E8E8E8" class="Normal" ><strong>UPLOADER UNE NOUVELLE IMAGE</strong></td> </tr> <tr> <td bordercolor="#E8E8E8" bgcolor="#E8E8E8"><form name="formulaire_envoi_fichier" enctype="multipart/form-data" method="post" action="upload.php"> <input type"text" name="comment" /> <br /> <span class="style6">Donner un commentaire explicite au document</span><br /> <br /> <input type="file" name="fichier_choisi"> <br> <br> <input type="submit" name="bouton_submit" value="Envoyer"> </form> </td> </tr> </table> <p><a href="index.php" class="Titre">Retour sur le site</a></p> </td> </tr> </table> </body> </html>
aidez moi !!!!
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 <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #EBEBEB; } .style1 {font-size: 11px; color: #000000; font-family: Arial, Helvetica, sans-serif;}; .Style3 {font-size: 11px; color: #666666; font-family: Arial, Helvetica, sans-serif; } --> </style><title></title></head> <body> <table width="600" border="1" align="center" cellpadding="0" cellspacing="10" bordercolor="#CCCCCC" bgcolor="#FFFFFF"> <tr> <td bordercolor="#FFFFFF"><?php error_reporting(0); $comment = $_POST["comment"]; if(!empty($_FILES["fichier_choisi"]["name"])) { $nomFichier = $_FILES["fichier_choisi"]["name"] ; $nomTemporaire = $_FILES["fichier_choisi"]["tmp_name"] ; $typeFichier = $_FILES["fichier_choisi"]["type"] ; $poidsFichier = $_FILES["fichier_choisi"]["size"] ; $codeErreur = $_FILES["fichier_choisi"]["error"] ; $chemin = "fichiers/" ; if(copy($nomTemporaire, $chemin.$nomFichier)) echo("<div class=\"style1\">Upload réussi du fichier $nomFichier ($titre) de type $typeFichier<br></div>") ; else echo("<div class=\"style1\">Echec de l'upload <br></div>") ; } else { echo("<div class=\"style1\">Choisir un fichier<br></div>") ; } include("db.php"); global $dbServer, $dbUser, $dbPass, $dbName; $link = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName); $compt = 0; $sql = "INSERT INTO photos VALUES ('','$nomFichier','$comment')"; $result = mysql_query($sql,$link); $requete = mysql_fetch_object($result); if($result) { echo("<div class=\"style1\">Ecriture dans la base de donnée : OK</div>") ; } else { echo("<div class=\"style1\">Echec</div>") ; } mysql_close($link); ?> </td></tr> </table> </body> </html>
Partager