I have successfully uploaded images to my database but now I need thumbnails for each of the image I am adding. I cannot seem to resize and store the image as a separate file in my webroot/img/thumbnail folder.
I need to upload a file and in the back end it should crop/resize the image and store that image as well as the original image in the database. Below is my controller function for when I press submit on the form.
if(!empty($this->request->data['Student']['imagePath']))
{
$file = $this->request->data['Student']['imagePath']; //put the data into a var for easy
move_uploaded_file($file['tmp_name'], 'img/thumbnail/' . $file['name']);
$this->request->data['Student']['imagePath'] = $file['name'];
move_uploaded_file($file['tmp_name'], 'img/' . $file['name']);
$this->request->data['Student']['resizeImage'] = $file['name'];
}
No errors. It just doesn't save to the DB