create attachments from stream

Giganews Newsgroups
Subject: create attachments from stream
Posted by:  slappyhack (slappyha…@gmail.com)
Date: Wed, 15 Mar 2006

I posted this in coders:

Delphi 2006 Indy 10 upgraded from delphi 7 and Indy 9

I hope this is the correct place to ask this question so I'll give it a shot.  I am saving my message attachments to an array of streams as follows:

type
  TAttachment = record
    mAttach: TMemoryStream;
    mFilename: string;
end;

arAttachment: array of TAttachment;

TIdAttachment(TheMsg.MessageParts.Items[x]).SaveToStream(arAttachment[i].mAttach);

  for x := 0 to high(arAttachment) do
  begin
    DataQueue.LoadMsgObjToDB(arAttachment[x].mAttach, intMessageID, trim(strTID), fstrSystem, trim(arAttachment[x].mFilename));
  end;

Then I am adding them to a binary field in informix this works fine the records are all created.  The issue arise when I try to extract my attachments and attach them to a new message, I cannot find a method to load attachment from stream.

I searched the web for samples but came across nothing but loading from file.

thanks

Jim

Replies