I have problem in moving same files to different folders.
There is below my code.
I stored city name in array.
Then for each city i want to upload image file in that image city folder (e.g Banner_NewYork).
If there are 4 cities then it will upload only in one city image folder which is first city in array and second time he show the message "Could not upload";
Code: Select all
if($City)//$city is an array storing city name
{
foreach($City as $cityname)
{
$bannername="Banner_".$cityname; //create folder name which is existing
if(is_dir("../../banner/".$bannername)){
if(strlen($_FILES['ProductBanner']['name'])>0){
$ProductBanner = $_FILES['ProductBanner']['name'];
move_uploaded_file($_FILES['ProductBanner']['tmp_name'],"../../banner/".$bannername."/".$ProductBanner) or die("Could not Upload") ;
}
}
}
}
Thanks in advance.