I would not suggest both of these approaches. Why?
Because multiple users may upload files with same name. Even same user can upload it multiple times with same name (So many users simply upload
Every time a file is uploaded, it is stored in a temporary location for the GET dictionary (try /tmp on linux). So your temporary name/location may be different if the same named file exists.
The intention might be to reupload the same file. In that case you might want to update.
So a safer option would be to get the checksum of the file (md5/sha1/sha256) and even store that in the database. That will tell you if the file is indeed the same. You can check the currently uploaded file for checksum.
CLICK HERE to find out more related problems solutions.