121 lines
2.9 KiB
PHP
Executable File
121 lines
2.9 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Upload
|
|
// -----------------------------------------------------
|
|
$test3='';
|
|
$test4='';
|
|
$test5='';
|
|
$target_dir='';
|
|
$continuer=0;
|
|
|
|
// on essaie de déduire le target dir en fonction de l'ancienne image
|
|
if ($theOldImage!='' && $theOldImage!='-') {
|
|
$test=substr ( $theOldImage, 0 ,3);
|
|
if ($test=="Htt" || $test=="htt") {
|
|
$test1 =$prodServer;
|
|
$test2=strlen($test1);
|
|
$test3=substr ( $theOldImage, $test2, strlen($theOldImage)-$test2 );
|
|
|
|
$test4=strripos ( $test3, "/");
|
|
$test5=substr ( $test3, 0 , $test4+1 );
|
|
$target_dir = "../../" .$test5;
|
|
$relatif=0;
|
|
}
|
|
else {
|
|
$test1=strripos ( $theOldImage, "/");
|
|
$test2=substr ( $theOldImage, 0 , $test1+1 );
|
|
$target_dir = "../." .$test2;
|
|
$relatif=1;
|
|
}
|
|
if (isset($debug[1]) && $debug[1] == '1') {
|
|
$debugMsg .= $monDebug (1,[
|
|
'test' => $test,
|
|
'test1' => $test1,
|
|
'test2' => $test2,
|
|
'test3' => $test3,
|
|
'test4' => $test4,
|
|
'test5' => $test5,
|
|
],'uploadIco.php');
|
|
}
|
|
if (is_dir ($target_dir)) {$continuer=1;}
|
|
}
|
|
|
|
if($continuer==0) {
|
|
// sinon en fonction de l'affichage
|
|
switch ($textesAffSection) {
|
|
case '1':
|
|
// $lib='catalogue';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
case '2':
|
|
// $lib='Navigation';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
case '3':
|
|
// $lib='Clients';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
case '4':
|
|
// $lib='Commandes';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
case '5':
|
|
// $lib='Menus';
|
|
$target_dir = "../Design/_icosMenus/";
|
|
break;
|
|
|
|
case '6':
|
|
// $lib='Elément de l\'entête';
|
|
$target_dir = "../Design/_bandeau/";
|
|
break;
|
|
|
|
case '7':
|
|
// $lib='Messages accueil';
|
|
$target_dir = "../Design/_pageAccueil/";
|
|
break;
|
|
|
|
case '8':
|
|
// $lib='Contact';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
case '9':
|
|
$lib='Mails';
|
|
$target_dir = "../Design/_mails/";
|
|
break;
|
|
|
|
// case '10':
|
|
// $lib='Langues';
|
|
// $target_dir = "../Design/_icones_web/";
|
|
// break;
|
|
|
|
case '10':
|
|
// $lib='Boutons';
|
|
$target_dir = "../Design/_boutons/";
|
|
break;
|
|
|
|
// case '12':
|
|
// $lib='Paramètres';
|
|
// $target_dir = "../Design/_icones_web/";
|
|
// break;
|
|
|
|
case '11':
|
|
// $lib='Messages quitter';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
|
|
default:
|
|
// $lib='Catalogue';
|
|
$target_dir = "../Design/_icones_web/";
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (isset($debug[1]) && $debug[1] == '1') { $debugMsg .= monDebug (1,['test' => $test, 'The file' => $_FILES["fileToUpload"]["name"] ?? '', 'target_dir' => $target_dir ],''); }
|
|
include ($includePathAdmin. "/_fonctions/uploadGenerique.php");
|
|
?>
|