def send_file(self, user_id, file_path):
        """
        @brief      send file
        @param      user_id  String
        @param      file_path  String
        @return     Bool: whether operation succeed
        """
        title = file_path.split('/')[-1]
        data = {
            'appid': Constant.API_WXAPPID,
            'title': title,
            'totallen': '',
            'attachid': '',
            'type': self.wx_conf['APPMSGTYPE_ATTACH'],
            'fileext': title.split('.')[-1],
        }

        response = self.webwxuploadmedia(file_path)
        if response is not None:
            data['totallen'] = response['StartPos']
            data['attachid'] = response['MediaId']
        else:
            Log.error('File upload error')
        
        return self.webwxsendappmsg(user_id, data)

        @brief      send file
        @param      user_id  String
        @param      file_path  String
        @return     Bool: whether operation succeed
        
wxbot_project_py2.7/wechat/wechat_apis.py