c# - Sending image (.jpg) byte data to an iOS device from a .NET web service, then on the iOS device, encoding it to its respective file type (.jpg) -


i have web service sends image byte data (.jpg) ios device. ios device saves data .jpg is, , once it's saved local file system, file cannot opened due "corrupt file" message when trying open on ios device. specifics of message irrelevant.

i .net developer developing web service. don't know objective c - have developer handling that.

question: need know if ios device expects byte data encoded way, whether has base64 string, etc. i'm not sure convention sending file via byte data on ios device. appreciated.

been there, on ios end. did solve problem have .net server send image base64 encoded string, said.

in ios end, dev must use base64 decoding class (there plenty on internet, 1 example: http://www.imthi.com/wp-content/uploads/2010/08/base64.zip), transform nsdata , create image data.

should this:

nsstring *b64string = @"string decode"; nsdata *imgdata = [decoderclass decodebase64fromstring:b64string]; uiimage *image = [uiimage imagewithdata:imgdata]; 

if data correct, should work. uiimage high-level class , should handle image types (jpg, png, etc) automatically, long data consistent.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -