Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
mihaizzav
Posts: 55
Registered: ‎08-26-2010
My Device: 8520
Accepted Solution

Programmatically retrieve large attachments

I succeded in retrieving programmatically 128Kb of attachment data from an email. After a lot of tinkering with the attachment size i realized that i'm limited to 32kb for a supported attachment part although my os is 4.6. ( I think this is a limitation from the vodafone BES ). But i managed to split an 128kb file in 4 x 32kb files and send an email with the 32kb files attached to it from pc to phone. My application on the phone gets the email and recreates the original file and stores it on the sdcard. This way I thought i could send much larger files (at least 1MB) but i encountered another problem , if the email has more than 4 attachments it is not received by the phone.

I guess now i can't send files larger than 128kb for my application (this sucks).

Has anyone ever tried this before ? Is there a more simpler way of programmatically retrieving large attachment files ?

Please use plain text.
Regular Contributor
mihaizzav
Posts: 55
Registered: ‎08-26-2010
My Device: 8520

Re: Programmatically retrieve large attachments

My attachment files have the name "x-rimdevice-MyDocFile0.doc.

I've tried spliting my original file in 64000 bytes files , but only one attachment is received by the phone, don't know why. I'm executing Transport.more() on every  SupportedAttachmentPart of the Message and after every Transport.more() i wait 10 sec but still, only one 64kb attachment is received.This thing doesn't happen if the attachments have 32kb, they are all received. Too bad my phone doesn't have os 5.0.

 

After many test with different attachment sizes I found out that sometimes only 2 or 3 attachments are received and the last one remains on the server.

 

Has anyone encountered this problem before and managed to solve it ?

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Programmatically retrieve large attachments

can't you download them using http? base64 (email) adds roughly a third to the real data size.

we usually send only a trigger mail with the link or similar, and download the content

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
mihaizzav
Posts: 55
Registered: ‎08-26-2010
My Device: 8520

Re: Programmatically retrieve large attachments

It worked. Now my application downloads the so called attachment files from my http server. I just send emails to the phone and I include an info text which tells the phone application what file to request from the server. My only problem now is that I don't have a public server and I have to connect through wifi with the phone in order to download attachments. Using the MDS-CS Simulator I found out that there is a limit on a HttpConnection which doesn't let me read more than 256Kb. I don't know if this is the case when using my gprs Vodafone connection.

On wifi it works fine , I managed to download 3mb files.

Please use plain text.