vendredi 17 avril 2015

Image upload not working in codeignitor

I create image upload code. this create directory first and then upload images to it.


In form I upload 3 images.


My Code is:



$dir_path = 'assets/images/product_images/'.$model;
mkdir($dir_path, 0777);

$i = 1 ;

foreach ($image as $new_image)
{
$dir_path_up = 'assets/images/product_images/'.$model."/";
$filename = $_FILES["$new_image"]["name"];
$image_name = $dir_path_up .$filename . $i. ".jpg";
echo $image_name;

$i++;
}
die();


Result of echo



assets/images/product_images/255_2555/1.jpg
assets/images/product_images/255_2555/2.jpg
assets/images/product_images/255_2555/3.jpg


But that images are not getting uploade in to directory. I echo the image name which i created. Its alredy renamed. Then why images not getting uploade into directory.


what is wrong in this??


Aucun commentaire:

Enregistrer un commentaire