Re: [mailcore] Attachment sizes
- Matt Ronge
- 2012-09-03 @ 00:33
On Aug 20, 2012, at 2:57 PM, Olivier Pallière <firstname.lastname@example.org> wrote:
> Hi guys,
> Like many around here I guess, I'm working on a revolutionary email app
for the Mac ;-)
> Still early hours though getting through with imap mail foundation part.
Right now I can get all messages from various mailboxes, display them in a
tableview and webview, and store them in a core data database.
> Upon getting a new message, or during initial scanning, I loop through
them and get the headers, body and list of attachments. I create
references to the CTBareAttachment and stash them in the persistent CD
> I download the attachments and store the files on the disk when a mail
is selected, on demand.
> Now I added a property on CTBareAttachment to return the size, found as
a size_t method on mime singlePart.
> But the sizes I get are inconsistent with the actual file size. I get
for example a reported size of 11510 when the actual file on he file
system is 8416.
> Is the size method returning a number including other components?
> Many thanks for your help,
> And my 'félicitations' on your job with Mailcore. Fantastic job!
I'm glad you found MailCore useful!
The difference you are seeing between the local file system and MailCore
is because the MIME length is the encoded length. I'm afraid the only way
to get what the file system size will be requires decoding the MIME part.
iOS Developer & Consultant
Central Atomics Inc.