| 112 | | $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part->encoding, true); |
| | 112 | |
| | 113 | //File download hack |
| | 114 | //Create tmp |
| | 115 | $filepath = tempnam("/tmp",'roundcube_attachment'); |
| | 116 | |
| | 117 | $fh = fopen($filepath,'w'); |
| | 118 | |
| | 119 | fwrite($fh,$IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part->encoding, false)); |
| | 120 | fclose($fh); |
| | 121 | |
| | 122 | //Send filesize to browser |
| | 123 | |
| | 124 | header(sprintf("Content-Length: %s",filesize($filepath))); |
| | 125 | |
| | 126 | |
| | 127 | //Send Contents of file |
| | 128 | readfile($filepath); |
| | 129 | |
| | 130 | //Remove tmp |
| | 131 | unlink($filepath); |