Record a small function
App Base64 bit up, the server got back to the picture to save, when the app request to take back the user picture, the server then turn the picture base64 the string back to App,app and then turn the picture
64base string to Picture
-(UIImage *) Stringtoimage: (NSString *) str {
NSData * imageData =[[nsdata alloc] initwithbase64encodedstring:str options: Nsdatabase64decodingignoreunknowncharacters];
UIImage *photo = [UIImage imagewithdata:imagedata];
return photo;
}
Picture to 64base string
-(NSString *) imagetostring: (UIImage *) Image {
NSData *imagedata = uiimagepngrepresentation (image);
NSString *image64 = [ImageData base64encodedstringwithoptions:nsdatabase64encoding64characterlinelength];
return image64;
}
http://picbase64.com/
Http://tool.css-js.com/base64.html
Ios-base64 photo && picture to Base64