Taken measures to prevent incorrect upload directory creating a folder in root.