开发者

How do i transform a file(any type of file) in Base64 to send to a web service Objective C

I need to send a files to a XML web service. The web service only accepts the file in a base64 format and rebuilds it in the back end. I need to know how do i开发者_JAVA百科 convert a file to base64 in Objective C.


Check below SO post

How do I do base64 encoding on iphone-sdk?

How can I decode data with Base64 in IPhone

How to Base64 encoding on the iPhone


UIGraphicsBeginImageContext(view.bounds.size);       
[view.layer renderInContext:UIGraphicsGetCurrentContext()];  
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();  
NSData *imagedata = UIImagePNGRepresentation(viewimage);  
NSString *encodedString = [imageData base64Encoding];

where view is the view where lines are drawn.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜