objective c - What's the difference between encodeBase64ForData and encodeWrappedBase64ForData when using SKPSMTPMessage -
in app, need attach video using skpsmtpmessage. @ first, learned dunja's code,
nsdata *videodata = [nsdata datawithcontentsoffile: videopath]; nsdictionary *videopart = [nsdictionary dictionarywithobjectsandkeys:@"video/quicktime;\r\n\tx-unix-mode=0644;\r\n\tname=\"video.mov\"",kskpsmtppartcontenttypekey, @"attachment;\r\n\tfilename=\"video.mov\"",kskpsmtppartcontentdispositionkey,[videodata encodebase64fordata],kskpsmtppartmessagekey,@"base64",kskpsmtppartcontenttransferencodingkey,nil];
but it's can't work out. tried solutions can imagined. finally, changed encode type of videodata: from
... [videodata encodebase64fordata],kskpsmtppartmessagekey ...
to
... [videodata encodewrappedbase64fordata],kskpsmtppartmessagekey ...
and works!
i have no idea what's difference between 2 api, can me out? thank dunja again, learned lot code.
take @ answer: gmail won't open .txt attachment created iphone app, depending on size - think there's bug in mime
a function called encodebase64fordatawrapped adds line breaks. perhaps should calling instead, , if attachment sufficiently long long base64 line confusing somebody.
here can see source code of both: http://code.google.com/p/skpsmtpmessage/source/browse/trunk/smtpsender/classes/nsdata%2bbase64additions.m
Comments
Post a Comment