some functionality to check existence and rename/delete uploaded files