hmmm jlo, should this line:

$filename=$file[ubound($file)]

be more like this:

$filename=$folder[ubound($folder)]

-Shawn