<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rooms_upload(self, rid, file, **kwargs):
 """Post a message with attached file to a dedicated room."""

        files = {
            'file': (os.path.basename(file), open(file, 'rb'), mimetypes.guess_type(file)[0]),
        }
        return self.__call_api_post('rooms.upload/' + rid, kwargs=kwargs, use_json=False, files=files)