Storing attachments in an xml file?

aliefeozkan

New member
Joined
Feb 13, 2011
Messages
1
Programming Experience
1-3
Hi all, I need urgent help about an issue. I am working on an application which users can store information in rtf format. My application uses tree nodes to organize information. Application uses its own file format to save data, which is based on xml format. In the new version, I want to add functionality of adding attachments. I mean when I user creates a file; he/she must be able to add attachments such as xls, doc, pdf files (or any other type) and store it in that single file. Adding just the link is enough for me, because I want the attachments be available when user sends the file to another computer. What am I am trying to do very similar to MS Word. In a doc file, you can add attachments. You save them in a single doc file, and when you want, you can display attachments in any computer. How can I do the same in my application?

My first idea was transferring the attachment into byte array, and save that byte array in xml file. But when I reload the attachment, it becomes corrupt.

I’ll be so happy if you could give me some ideas about this issue. Thanks.
 
Back
Top