Abogil
04/01/2007, 23h30
PeGaZe peux-tu éditer ton premier message et cocher l'icône " Réglé"
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é
";
}
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