encode image to base64, get a invalid base64 string (ios using base64EncodedStringWithOptions)

后端 未结 4 749
误落风尘
误落风尘 2021-02-05 19:39

Here is my code.

  UIImage *img = [UIImage imageNamed:@\"white.jpeg\"];
  NSData *imageData = UIImagePNGRepresentation(img);
  NSString *imageString = [imageData         


        
4条回答
  •  遥遥无期
    2021-02-05 19:54

    Yap, I find the problem is I don't encode the url.

    In the post data my base64 "+" character was translate to " " character.

    So I get the invalid base64 string.

    Thanks Logan.

提交回复
热议问题