
# 上传个人头像
#### uploadSelfAvatarWithFilePath:callback:
**接口描述**
该接口用于上传用户自己头像。
**注意事项**
1. 文件路径为头像路径。
2. 大小限制200k。
3. 只支持jpg、png。
4. 为了头像展示效果，建议图片宽高比为1:1。
5. 回调error表示错误信息，nil表示成功。
**方法定义**
```
- (void)uploadSelfAvatarWithFilePath:(NSString *_Nullable)filePath callback:(_Nonnull HWMSDKCompleteHandler)callback;
```
**参数描述**
表1 
| 参数       | 是否必须 | 类型          | 描述     |
|:---|:---|:---|:---|
| filePath | 否    | NSString \* | 头像文件路径 |
   
**返回值**
无
**示例代码**
```
/// 上传用户个人头像
- (void)uploadSelfAvatar {
    [[HWMBizSdk getBizOpenApi] uploadSelfAvatarWithFilePath:self.headImgPath callback:^(NSError * _Nullable error, id  _Nullable result) {
        if (error) {
            [UIUtil showMessage:[NSString stringWithFormat:@"上传失败%@", error.localizedDescription]];
        } else {
            [UIUtil showMessage:@"上传成功"];
        }
    }];
}
```
