Voici mon script PHP utilisé pour uploader des images dans un album :
Le problème est le suivant, j'ai à chaque fois cette page ensuite qui s'affiche quand j'essaye d'uploader une image :
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 if( isset($_POST['upload']) ) // si formulaire soumis { $content_dir = "../../album/photos/"; // dossier où sera déplacé le fichier $tmp_file = $_FILES['fichier']['tmp_name']; if( !is_uploaded_file($tmp_file) ) { exit("Le fichier est introuvable"); } // on vérifie maintenant l'extension $type_file = $_FILES['fichier']['type']; if( !strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'bmp') && !strstr($type_file, 'gif') && !strstr($type_file, 'png') ) { exit("Le fichier n'est pas une image"); } // on copie le fichier dans le dossier de destination $name_file = $_FILES['fichier']['name']; if(already_exist($name_file,$album_sel)) $name_file = 'M' . $name_file: if( !move_uploaded_file($tmp_file, $content_dir . $name_file) ) { exit("Impossible de copier le fichier dans $content_dir"); } echo "Le fichier a bien été uploadé<br>"; }
Service non permis? Mauvais script de ma part (trouvé sur le net)? J'ai un hébergement 60GP chez OVH. Il m'a semblé lire que l'upload d'image fonctionne pour des images inférieurs à 2Mo (dans mon cas, les images sont inférieurs à 50 ko !!!)Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, tech@ovh.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.37 Server at www.bike55.be Port 80
Merci d'avance
Partager