Thanks everyone for your help... gammaster I'm using your code.
But now I have a little problem with it.. I made the mistake of saying I want to DELETE the file.
I actually want to rename the file using the .jpg extension.
I tried using this:
exec("ren ".$file." ".$file.".jpg");
but I keep getting CGI error messages and I was getting a folk message at one point.. I'm on a windows server.
So how can I RENAME the files instead of delete them?