New logic of addFile(): Use filename instead of path.