How would you handle the downloading of large amount of data?

moster67

Expert
Licensed User
Longtime User
How would you handle the downloading of large amount of data?

When connecting to a POP3-server using telnet and downloading attachments on my device, I get a after a while (after having received 300-400KB) OutOfMemoryExceptions. Nothing strange about that but since Outlook for PocketPC can handle attachments up to 3-4MB, there must be a way to do it!

I think I need to take the content of the buffer and write/save it in a file on storage, then I must empty the buffer and start all over again. Is this the best procedure? Any other ways of doing it? Some pseudo-code showing how to do it would be great.

rgds,
moster67
 

moster67

Expert
Licensed User
Longtime User
Sorry for not writing clear enough. No - Pocket Outlook works nicely.

The problem is my code. I wanted to try out POP3 (using telnet and socket) and download my e-mails and attachments from my provider's mail-server. I have no problems connecting with my code (on my device) to the POP3-server and downloading relative headers and the text containing the e-mails and the attachments.

As long as I am downloading single e-mails or e-mails with small attachemnts (up to 150KB), I have no particular problems. The problem is when I need to download large amount of data (300KB and more) - then I get OutOfMemoryExceptions.

I guess that Pocket Outlook, when downloading a file of 3-4MB, retrieves the data in chunks in view of the huge amount of data it must handle and the risk of OutOfMemoryExceptions. So if Pocket Outlook can do this, I guess that I can also do it. That's why I asked if anyone could post some pseudocode for retrieving data in chunks using a socket-connection.

Thanks.


Hi,

Quick questions. You say you are using Outlook for PocketPC to download attachments but its not working (Outofmemory error).
 
Last edited:
Top