Rieekan,
thank you for your input. I've tried what you've suggested and it didn't work. I must be doing something wrong. please look at the code below, including your suggestion inserted.
##--------
# uploadImage()
##--------
sub uploadImage
{
$upfile = lc(join '', split / /,(split/\\/...