Updated given the TM wrt upload_dir as a parameter