I can upload the image and resize with phpthumb, but how can i also have the original image uploaded too?
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
// upload the image
if ($form->station_image->isUploaded()) {
$form->station_image->receive();
$station_image = '/upload/images/radio/' . basename($form->station_image->getFileName());
//upload thumb
include_once '../library/PhpThumb/ThumbLib.inc.php';
$thumb = PhpThumbFactory::create($form->station_image->getFileName());
$thumb->resize(50, 50)->save($form->station_image->getFileName());
//thumb ends
}else{
echo 'cannot upload'. exit;
}
My forms look like this
$station_image->setLabel('Upload File: ')
->setDestination(APPLICATION_PATH.'/../public/upload/images/radio')
->addValidator('Extension', false, 'jpg,png,gif')
->addValidator('Size', false, 902400)
->addValidator('Count', false, 1)
->setRequired(false);
Please help me how to upload multiple thumbnail or how can i get the original file uploaded as well ? Thanks