i have done image uploading .in my webroot folder.
how to upload image in cakephp2.5+ and store it in webroot folder
echo $this->Form->input('varbigimg', array('type' => 'file'));
this is my add image in view file if i write same in edit.ctp then it will not display name. it will ask browse image again.
so i want if image is uploaded then it display image in form. in edit page as well as in add page thanks
First inside your controller class use:
Second inside Controller/Component Folder paste
ImageResizeComponent.php
file.Now imageResize component. as per your Old code in other question. Just after Uploading.
//Your old code , Regular image upload.
//Thumb code (add After your previous image upload code as above)
Make folder
here webroot/courseImages/thumb/
And check in that folder if small image is there//Update To show image on Edit screen :
As $this->request->data['Tour']['varbigimg']; stores image name .And small image is having same name And uploaded to just differend folder , You just need to append Thumb image path to
img
and at the end just append image name in Table for that ID of tour.Just in case if u dnt hav ImageResizeComponent.php file CREATE it