I'm trying to take attachments that were saved on a database and place them on a harddrive. However, I can create the file, however when I open the file I get system.Byte[] or image cannont be viewed on the files.
Here is the code I am using:
public void saveattachment( String MKS_attachmentN ame, Byte[] MKS_attachmentC ontent)
{
StreamWriter sw = new StreamWriter("C :/MKSattachments/" + MKS_attachmentN ame);
sw.Write(MKS_at tachmentContent );
sw.Close();
}
I stream the attachment Name into the file name and the write the contents of the file using the .write() method. The MKS_attachmentC ontent is in the type Byte[], which I'm currently unfimiliar with.
Any help I would be grateful for.
Thank you in advance,
Newbie19
Here is the code I am using:
public void saveattachment( String MKS_attachmentN ame, Byte[] MKS_attachmentC ontent)
{
StreamWriter sw = new StreamWriter("C :/MKSattachments/" + MKS_attachmentN ame);
sw.Write(MKS_at tachmentContent );
sw.Close();
}
I stream the attachment Name into the file name and the write the contents of the file using the .write() method. The MKS_attachmentC ontent is in the type Byte[], which I'm currently unfimiliar with.
Any help I would be grateful for.
Thank you in advance,
Newbie19
Comment