Vraiment pas logique.
Voici mon code :
<?php session_start(); ?>
<!-------------------->
<!---- Menu haut
<!-------------------->
<!--connexion mysql-->
<?php include("/class/cadeauxplaisirDB.php"); ?>
<!--fonctions-->
<?php include("../../../functions/functions.php"); ?>
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$nom_photo_renomme = md5(uniqid(rand(), true)); // uniquid() Génère un identifiant unique basé sur la date et heure courante en microsecondes.
$extension_photo = strtolower(strrchr($_FILES['Filedata']['name'], '.')); //strrchr renvoie l'extension avec le point // strtolower met l'extension en minuscule
$nom_photo_renomme_avec_extension = $nom_photo_renomme . $extension_photo;
$targetFile = str_replace('//','/',$targetPath) . $nom_photo_renomme_avec_extension;
// Voici ma session qui ne se créé pas sous Firefox ???????
$_SESSION['articles']['photo1'] = $nom_photo_renomme_avec_extension;
// $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
// $fileTypes = str_replace(';','|',$fileTypes);
// $typesArray = split('\|',$fileTypes);
// $fileParts = pathinfo($_FILES['Filedata']['name']);
// if (in_array($fileParts['extension'],$typesArray)) {
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo "1";
// } else {
// echo 'Invalid file type.';
// }
}
?>