'; if ( !empty($siren) && isset($_FILES['file']) && $_FILES['file']['error']!=UPLOAD_ERR_NO_FILE ) { $logoFile = $_FILES['file']; $tmp_file = $logoFile['tmp_name']; if ( $logoFile['error']!=UPLOAD_ERR_OK ) { $output.= ''; } elseif ( !is_uploaded_file($tmp_file) ){ $output.= ''; } else { // On vérifie maintenant l'extension $extAuthorized = array('jpeg', 'jpg', 'png', 'gif', 'bmp'); $type_file = str_replace('image/', '',$logoFile['type']); $ext = ''; if ( in_array($type_file, $extAuthorized) ){ $ext = $type_file; } if ( !empty($ext) ){ // on copie le fichier dans le dossier de destination $name_file = 'tmp_'.$siren.'.'.$ext; if( !move_uploaded_file($tmp_file, PATH_LOGOS . $name_file) ) { $output.= ''; } else { $output.= 'Sauvegarder l\'image'; $output.= '
'; $output.= 'Editer l\'image'; } } else { $output.= ''; } } $output.= ''; echo $output; }