Again, you need to read your code more closely:
rename('../Chat/uploads/'.["fileToUpload"],'../Chat/uploads/'.$username);
Look at the name you are using as the source file to be renamed, there is no such name. And you should check the result of the rename function; don't just assume that it succeeds.
And rather than repeating expressions like
$_FILES["fileToUpload"]
multiple times, set the name into a variable at the beginning when you check it for validity.