francescu youpee !! | salut,
j ai un soucis qui me laisse perplexe... Un script d upload d images qui fonctionne tres bien, mais seulement sur le pc de l"admin", la majorité des photos ne s'upload pas. J ai fait des tests afin de trouver une correlation mais rien...(taille type etc...). Je recupere les meme photos ppour tester sur une autre machine et la tout marche .....
et je suis perdu pour info : a un enregistrement correspond 1 a 3 images.
Code :
- <?
- // HTTP/1.0
- include("./connect.php5" );
- //---------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //enregistrer un mouveau bien---------------------------------------------------
- if($action == "nouveau" )
- {
- $query_nv= "insert into bien (nom_bien, type, type_bien, surface, nb_piece, prix,commentaire_1, commentaire_2, departement ,ville, code_postal, coeur, reference) values('$nom_bien','$type','$type_bien', '$surface','$nb_piece', '$prix','$commentaire_1','$commentaire_2','$departement','$ville','$code_postal','$coeur','$reference')";
- $result_nv = mysql_query($query_nv);
- $id = mysql_insert_id();
- //uplaod des images
- if ($img_1) {
- if (is_uploaded_file($img_1)) {
- if (move_uploaded_file($img_1, "images/img_admin/" . $id . "_a.jpg" )) {
- chmod("images/img_admin/" . $id . '_a.jpg', 0777);
- }
- }
- }
- if ($img_2) {
- if (is_uploaded_file($img_2)) {
- if (move_uploaded_file($img_2, "images/img_admin/" . $id . "_b.jpg" )) {
- chmod("images/img_admin/" . $id . "_b.jpg", 0777);
- }
- }
- }
- if ($img_3) {
- if (is_uploaded_file($img_3)) {
- if (move_uploaded_file($img_3, "images/img_admin/" . $id . "_c.jpg" )) {
- chmod("images/img_admin/". $id ."_c.jpg", 0777);
- }
- }
- }
- if(!$result_nv) echo "Erreur d'enregistrement";
- }
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
- //Mise à jour d'un bien------------------------------------------------
- if($action == "update" )
- {
- $query_up="update bien set nom_bien='$nom_bien', type='$type', type_bien='$type_bien', surface='$surface', nb_piece='$nb_piece', prix='$prix' , commentaire_1='$commentaire_1', commentaire_2='$commentaire_2', departement='$departement' , ville='$ville', code_postal='$code_postal', coeur='$coeur', reference='$reference' where num_bien='$id';";
- $result_up = mysql_query($query_up);
- if(!$result_up) echo "Erreur d'enregistrement";
- }
- # Traitement du fichier image 1
- # --------------------------------------------------------------------------
- if ($img_1) {
- if(is_file("images/img_admin/" . $id . "_a.jpg" )) {
- unlink("images/img_admin/" . $id . "_a.jpg" );
- }
- if (is_uploaded_file($img_1)) {
- if (move_uploaded_file($img_1, "images/img_admin/" . $id . "_a.jpg" )) {
- chmod("images/img_admin/" . $id . '_a.jpg', 0777);
- }
- }
- }
- if ($img_2) {
- if(is_file("images/img_admin/" . $id . "_b.jpg" )) {
- unlink("images/img_admin/" . $id . "_b.jpg" );
- }
- if (is_uploaded_file($img_2)) {
- if (move_uploaded_file($img_2, "images/img_admin/" . $id . "_b.jpg" )) {
- chmod("images/img_admin/" . $id . "_b.jpg", 0777);
- }
- }
- }
- if ($img_3) {
- if(is_file("images/img_admin/" . $id . "_c.jpg" )) {
- unlink("images/img_admin/" . $id . "_c.jpg" );
- }
- if (is_uploaded_file($img_3)) {
- if (move_uploaded_file($img_3, "images/img_admin/" . $id . "_c.jpg" )) {
- chmod("images/img_admin/". $id ."_c.jpg", 0777);
- }
- }
- }
- ?>
|
si vous avez une idee....
ps : j ai virer tout firewall et anitvirus mais rien a faire
|