That assignment is actually not needed. The upload functions instantiate the filespec class which will then call the get_mimetype method in filespec::move_file().