verot.net upload class thumbnail upload not working

Friday, July 4, 2014

No problem uploading the original and greyscale image files but does not create a thumbnail.


How can i solve this problem?


My codes are as follows:



$default='';
$other='';
$thumb='';
$files = array();
foreach ($_FILES['images'] as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
$uploaded = array();
foreach ($files as $file):
$handle = new Upload($file);
if ($handle->uploaded):
$this_upload = array();
$handle->file_new_name_body = substr(base64_encode(uniqid(true)), 0, 20);
$handle->Process(realpath("../")."/uploads/products/default/");
$this_upload[] = $handle->file_dst_name;
$default = $default. $handle->file_dst_name . ',';
//greyscale
$handle->image_greyscale = true;
$handle->file_new_name_body = substr(base64_encode(uniqid(true)), 0, 20);
$handle->Process(realpath("../")."/uploads/products/other/");
$other = $other. $handle->file_dst_name . ',';
//resize
$handle->image_resize = true;
$handle->image_ratio_x = true;
$handle->image_y = 50;
$handle->file_new_name_body = substr(base64_encode(uniqid(true)), 0, 20);
$handle->Process(realpath("../")."uploads/products/thumb/" );
$thumb = $thumb. $handle->file_dst_name . ',';
endif;
endforeach;






http://ift.tt/1rt21nw