in reply to Rename Uploaded Files

One other thought.

If your script knows how to rename the file, then it probably knows the new name at the time the file is uploaded. So simply save the file with that new name and forget the rename process.