If you are running on a windows server, the 777 that your ftp client tells you does not mean anything, ftp clients are unable to read or set the security for NT folders.
You need to getyour host to set the permissions for the IUSR_XXXXXX account on your uploaded directory. The movefile renames the file you uploaded with a different name, none of this will be a problem if your permissions are set correctly