Multiple Images Upload in CakePHP
In this post we will see how to uload multiple images in cakephp.I am going to show the additional code for multiple image handling for both the action Add and Edit.What all you need is to simply copy paste in your application according to needs. My table : posts CREATE TABLE `posts` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL, `body` text NOT NULL, `image1` varchar(200), `image2` varchar(200), `image3` varchar(200), PRIMARY KEY (`id`) ) As you can see what are the fields of my 'posts' table.I have three fields for the images.Example: image1,image2,image3 etc.You may have different fields. Add the code given below for multiple image handling. My uploaded images are stored in app/webroot/img/uploads/posts folder.I have one default image called 'no-icon.jpg' in the same folder which will be shown if the correct image is not available or in case of NULL value. Controller : PostsController.php Add Function public function add() { $this-...