hello.....
i am using this function to create a folder in images folder. all uploaded images are store in newly created folder.it is working fine when run the code..it is creating images/newfoldername/uploadedimages.jpg in localhost. but in server same code is not working. it is creating images/uploadedimages.jpg and also creating null folder images/newfolder. there is nothing files in images/newfoldername/uploadedimages.jpg. where is the problem in server?
public function downloadImages() {
$imgUrlArray=$this->getImageUrls($urlArray);
$dir="images/".$this->imagesOf;
@mkdir($dir,0777);
for($i=0; $i<count($imgUrlArray); $i++) {
$imageName = basename($imgUrlArray[$i]);
$info = @getimagesize($imgUrlArray[$i]);
if(trim($this->sizeLimit) != "" && $this->sizeLimit > 0) {
if (count($info) > 0 && $info[0] >= $this->sizeLimit) {
if(trim($imageName) != '' ) {
copy($imgUrlArray[$i], $dir."/".$imageName);
}
}
}
else {
if(trim($imageName) != '' ) {
copy($imgUrlArray[$i], $dir."/".$imageName);
}
}
}
}