Précédent   Forum des professionnels en informatique > PHP > Langage > Fichiers
Fichiers Forum d'entraide sur les fichiers avec PHP. Avant de poster -> FAQ fichiers et Sources fichiers
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 20/03/2007, 16h11   #1
Invité régulier
 
Étudiant
Inscription : mars 2007
Messages : 60
Détails du profil
Informations personnelles :
Âge : 24

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mars 2007
Messages : 60
Points : 7
Points : 7
Par défaut [Upload] Problème d'upload de video

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 :
Code :
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">&nbsp;</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>
et lupload :
Code :
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>
aidez moi !!!!
tondeuz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h13   #2
Rédacteur
 
Avatar de RideKick
 
Homme
Directeur technique
Inscription : septembre 2006
Messages : 5 959
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Directeur technique
Secteur : High Tech - Produits et services télécom et Internet

Informations forums :
Inscription : septembre 2006
Messages : 5 959
Points : 10 889
Points : 10 889
Bonjour ,

tes videos pesent combien en moyenne ?
__________________
Pas de questions techniques en MP please

Mon site perso
RideKick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h27   #3
Invité régulier
 
Étudiant
Inscription : mars 2007
Messages : 60
Détails du profil
Informations personnelles :
Âge : 24

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mars 2007
Messages : 60
Points : 7
Points : 7
bin dans les 50m en gros mais jai deja reconfigurer la taille max dans le php.ini
tondeuz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h30   #4
Rédacteur
 
Avatar de RideKick
 
Homme
Directeur technique
Inscription : septembre 2006
Messages : 5 959
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Directeur technique
Secteur : High Tech - Produits et services télécom et Internet

Informations forums :
Inscription : septembre 2006
Messages : 5 959
Points : 10 889
Points : 10 889
et le max_execution_time() aussi ?
__________________
Pas de questions techniques en MP please

Mon site perso
RideKick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h33   #5
Invité régulier
 
Étudiant
Inscription : mars 2007
Messages : 60
Détails du profil
Informations personnelles :
Âge : 24

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mars 2007
Messages : 60
Points : 7
Points : 7
ça non il faut que je mette combien ? il est a 30 la
tondeuz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h35   #6
Rédacteur
 
Avatar de RideKick
 
Homme
Directeur technique
Inscription : septembre 2006
Messages : 5 959
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Directeur technique
Secteur : High Tech - Produits et services télécom et Internet

Informations forums :
Inscription : septembre 2006
Messages : 5 959
Points : 10 889
Points : 10 889
0 pour desactiver la limite de temps !
__________________
Pas de questions techniques en MP please

Mon site perso
RideKick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h37   #7
Rédacteur
 
Avatar de Yogui
 
Homme Guillaume Rossolini
Directeur technique
Inscription : février 2004
Messages : 13 720
Détails du profil
Informations personnelles :
Nom : Homme Guillaume Rossolini
Localisation : France

Informations professionnelles :
Activité : Directeur technique

Informations forums :
Inscription : février 2004
Messages : 13 720
Points : 17 355
Points : 17 355
Salut

Le mieux serait d'appeler set_time_limit(0) au début de ton script.
__________________
Mes articles - Zend Certified Engineer (PHP + Zend Framework)
Ressources PHP - Ressources Zend Framework
Yogui est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 16h37   #8
Invité régulier
 
Étudiant
Inscription : mars 2007
Messages : 60
Détails du profil
Informations personnelles :
Âge : 24

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mars 2007
Messages : 60
Points : 7
Points : 7
bin sa me repond toujours la même chose :
Choisir un fichier

Ecriture dans la base de donnée : OK
tondeuz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/03/2007, 17h57   #9
Rédacteur
 
Avatar de Yogui
 
Homme Guillaume Rossolini
Directeur technique
Inscription : février 2004
Messages : 13 720
Détails du profil
Informations personnelles :
Nom : Homme Guillaume Rossolini
Localisation : France

Informations professionnelles :
Activité : Directeur technique

Informations forums :
Inscription : février 2004
Messages : 13 720
Points : 17 355
Points : 17 355
Je te recommande de faire un tour par mes tutoriels pour voir la structure HTML d'un formulaire avec champ type="file", il te manque certains éléments
__________________
Mes articles - Zend Certified Engineer (PHP + Zend Framework)
Ressources PHP - Ressources Zend Framework
Yogui est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/03/2007, 15h15   #10
Invité régulier
 
Étudiant
Inscription : mars 2007
Messages : 60
Détails du profil
Informations personnelles :
Âge : 24

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mars 2007
Messages : 60
Points : 7
Points : 7
je viens de my mettre je ne comprend rien aurais tu une reponse plus precise stp merci
tondeuz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/03/2007, 15h21   #11
Rédacteur
 
Avatar de Yogui
 
Homme Guillaume Rossolini
Directeur technique
Inscription : février 2004
Messages : 13 720
Détails du profil
Informations personnelles :
Nom : Homme Guillaume Rossolini
Localisation : France

Informations professionnelles :
Activité : Directeur technique

Informations forums :
Inscription : février 2004
Messages : 13 720
Points : 17 355
Points : 17 355
Ton formulaire doit ressembler à ce qui est présenté ici : Du texte + des fichiers : multipart/form-data
__________________
Mes articles - Zend Certified Engineer (PHP + Zend Framework)
Ressources PHP - Ressources Zend Framework
Yogui est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 05h11.


 
 
 
 
Partenaires

Hébergement Web