08-11-2008 02:57 AM
I'm a new programmer of Blackberry Application.
i create a program that automatically read from Store, using FolderListener.
when i got event from FolderEvent, i got Message which is instanceof Multipart.
I create BodyPart from Multipart, to access my attachment. (bodypart index number 1)
when I check bodypart.hasMore() it's return true.
I do Transport.more(bodypart, true);
I create a loop to check it bodypart.hasMore(), until 2 minutes it still true
(found attachment on server).
why I can't complete my message?
(the bodypart.hasMore() never return false).
is there any how to to get attachment from Message (mail api)?
my attachment is a binary with base64 format, it size only 100 Bytes.
I don't have any idea, is my attachment included on (2K bytes of first) message?
Any help would be much appreciated.
Solved! Go to Solution.
08-11-2008 05:41 PM
Please have a look at this sample.
What Is - Delivering attachment contents to a BlackBerry device
Article Number: DB-00475
BlackBerry handheld software version 4.5.0 introduced the ability to access attachments without using an AttachmentHandler. The following link explains this.
How To - Access HTML email messages
Article Number: DB-00666
It demonstrates getting the HTML or text portions of an email message, but the same principles can apply to attachments. Note that this requires a BlackBerry Enterprise Server or BlackBerry Internet Service account. The ESS and MDS Simulators do not support HTML email delivery.
There is also an issue in a few early releases of version 4.5.0 that prevents you from requesting more of an attachment (using the second method). This is fixed in BlackBerry handheld software version 220.127.116.11 and higher.
08-11-2008 10:07 PM
Thank you Mark,
the problem now solved.
solution of my problem is change the AttachmentHandler to listen
attachment with content-type: octet-stream.
i don't know why, the blackberry device cannot recognize
that i change my content-type to my own string.
your links are awesome.