If server side exists a file "example.doc", and you try to upload a file with the same name "example.doc", then your uploaded file will overwrite the old one, so how to prevent it? You just need a simple Lua script for the FTP/SSH/HTTP event "BeforeFileUploaded":