2016-04-02 14 views
-1

image64 formatta veri şifre etmekIOS uygulamadan geçen sunucu tarafında image64 kodlanmış verilerin kodunu çözmek mümkün

doğru bir şekilde image64 bit biçiminde verileri kodlamak için çeşitli yollar bulunan

image64 bit veri göndermeyi çözümleyemez sunucu tarafı, kodlanmış veriler sunucuda geçmeden önce kolayca çözülebilir. kodlanmış verinin aynı kullanılan

kod verileri göndermek için kullanılan verileri

NSData* data = UIImageJPEGRepresentation(image,0.01); 

[data writeToFile:path atomically:YES]; 
imageData = [UIImageJPEGRepresentation(image,0.01) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 

kod kodlamak için sunucuda deşifre edebilir ios platformundan gönderdiklerimizle

ve kodlanmış veriler android uygulamadan alınan bir sunucu

servicesManager = manager; 
NSMutableURLRequest *theRequest=[NSMutableURLRequest 
           requestWithURL:[NSURL URLWithString: 
               urlParam] 
           cachePolicy:NSURLRequestUseProtocolCachePolicy 
           timeoutInterval:60.0]; 

NSString *post = [self createQueryStringForDataDictionary:dataDictionaryParam]; 

self.urlTo = urlParam; 
NSLog(@"post data : %@",post); 

[theRequest setHTTPMethod:@"POST"]; 

NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding]; 
NSString *postLength = [NSString stringWithFormat:@"%lu",(unsigned long)[postData length]]; 
[theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
[theRequest setHTTPBody:postData]; 

NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; 
if (con) { 
    _receivedData=[NSMutableData data]; 
} else { 
    //something bad happened 
} 

cevap

0

Bu par kullanılan kodun t denemek image64

UIImage *encodeImage = [UIImage imageNamed:@"userImage.png"]; 
NSString *stringImg = [UIImagePNGRepresentation(encodeImage) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; 

Bu kodlanmış dize sunucusuna

gönderilebilir kodlamak ve Bana uyar iamge64

NSData *imgdata = [[NSData alloc]initWithBase64EncodedString:stringImg options:NSDataBase64Encoding64CharacterLineLength]; 
UIImage *decodeImage = [UIImage imageWithData:imgdata]; 

bu görüntüyü deşifre etmek bu kodu kullanılan bu o olacak ayrıca sizin için çalışın

İlgili konular