Well, the answer is :
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/thumb/" . $targetfilename, $width, $height);
}
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.
// first you check if the is done uploading in the tmp directory with is tmp name
if (is_uploaded_file(@$_FILES['ulimage']['tmp_name']))
{
// here, you rebuild a explicit name using the original filename and a
// unique ID to avoid erasing another one
$targetfilename = ImageHelper::treatFilename(uniqid() . "_" . $_FILES['ulimage']['name']);
// you rename the file an put it in ./tmp, a subdir of the
// script file (because of dirname(__FILE__))
move_uploaded_file($_FILES['ulimage']['tmp_name'], dirname(__FILE__) . "/tmp/" . $_FILES['ulimage']['name']);
// Here create a rezided copy
// so it's here you can decide to make it go to ./tmp/thumb
// make sure the dir exists before because you have no clue here
// if ImageHelper will create it for you if not
ImageHelper::resizeImage(dirname(__FILE__) . "/tmp/thumb/" . @$_FILES['ulimage']['name'], dirname(__FILE__) . "/tmp/thumb/" . $targetfilename, $width, $height);
}