You can use FUDAPI for this purpose. However, if you want to do it directly you need to use foff (file offset) and length parameter. Then you look at the file_id for the message and you know which file you need to open, seek to offset and read length bytes.