Topic Path: Symbol Reference > Classes > TIdAttachmentFile Class > TIdAttachmentFile Methods > OpenLoadStream Method
ContentsIndexHome
PreviousUpNext
TIdAttachmentFile.OpenLoadStream Method

Specifies the method used to open and initialize the internal stream needed for loading an attachment before transmission.

function OpenLoadStream: TIdStream; override;

TStream - Stream used to access the contents of the message part.

OpenLoadStream is an overridden TStream function that implements the method used to open and initialize the internal stream needed for loading an attachment before transmission. 

OpenLoadStream is used to ensure that the internal TFileStream for accessing data in the message part is created prior to reading values during message transmission. OpenLoadStream creates the TFileStream using the file name specified in StoredPathName with the fmOpenRead and fmShareDenyWrite file mode constants. 

During transmission, values in the internal stream are encoded based on the properties specified in the message or message part using methods in TIdMessageClient like SendHeader and SendBody. 

CloseLoadStream is used to ensure that the internal stream for accessing data in the message part is freed when all values have been read during transmission. 

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.