Topic awaiting preservation: Can't download multipart message body to database?????? |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: you tell me |
posted 09-29-2007 13:15
Hi guys I need some help right here.. I'm tweaking roundcube mail so that at the click on a button a selected message is copied from the mail server into a table on my local database. SO far I've made a couple of tweaks so that it takes a copy of the mail headers from the mail server and it copies teh headers .. but I can't find the way to copy the message body and attachments and message parts as well to the database. code: $headers = $this->get_headers($one_uid, $key);
code: $headers->structure = &$this->get_body($one_uid);
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 09-30-2007 18:14
Sorry, again I don't know roundcube - what other methods are defined in a message? |
Bipolar (III) Inmate From: you tell me |
posted 10-01-2007 10:23
Hmmmm ok I think I've figured this part out - roundcube mail apparently refers to a globally declared MESSAGE variable which contains in teh form of an array the information on th parts and structure of the message to be viewed.. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-01-2007 11:57
Nah, keep it in this thread. |
Bipolar (III) Inmate From: you tell me |
posted 10-01-2007 12:24
Hmmm you have a point but the thing is that we need to maintain a local db copy of the messages as well as all the attachments that come with it.. anyway I just discovered the function that donwloads the attachments and for testing fixed it so it dumps the attachments into a db as a BLOB [ sorry bout that ]. Its the function rcube_imap->get_message_part() just pass in the UID of teh message and part needed and it returns the entire content to be used as you wish ... |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-01-2007 13:17
well, how about the file system? |
Bipolar (III) Inmate From: you tell me |
posted 10-01-2007 14:10
quote:
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-01-2007 22:18
you should output javascript that retrieves the attachment 'in the background' by doing another request to your php server |
Bipolar (III) Inmate From: you tell me |
posted 10-02-2007 11:26
Hmmmm... right now what my logic is that I'm executing a loop for all the selected messages. Like the logic is code: Foreach(selected-uids as one_id) message = get_message(uid) foreach(message->parts as one-part) if(one-part is attachment) { download one-part insert as attachment into db }else{ insert as text message } Loop Loop
|
Bipolar (III) Inmate From: you tell me |
posted 10-02-2007 11:28
HMmm ok I'm getting this littel error.. what does this mean: code: PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1081697 bytes) |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-02-2007 13:19
And that's where the fun starts... |