I’m trying to play with image resizer and I got the following code
if (is_uploaded_file(@$_FILES['ulimage']['tmp_name'])){
$targetfilename = ImageHelper::treatFilename(uniqid() . "_" . $_FILES['ulimage']['name']);
move_uploaded_file($_FILES['ulimage']['tmp_name'], dirname(__FILE__) . "/tmp/" . $_FILES['ulimage']['name']);
ImageHelper::resizeImage(dirname(__FILE__) . "/tmp/" . @$_FILES['ulimage']['name'], dirname(__FILE__) . "/tmp/" . $targetfilename, $width, $height);
}
For now, the original image and the thumbnail will place in same folder.
Let me know..
Well, the answer is :
But maybe you’d like to understand a bit the code you copy and past from the Net before using it. Using $_ vars without escaping system and with @ to hide error is not really calling for trust…
EDIT : I’m giving advices, but maybe it’s better to give some explanation as well.