AddAssociatedFileFromStream

Associated files, attachments, streams

Description

Creates one embedded-file stream from Source and registers its file specification in both the embedded-file name tree and catalogue associated-file array

Syntax

Function AddAssociatedFileFromStream(Source: TStream; Const DisplayName, MIMEType, Description, Relationship: WideString): Integer;

Parameters

SourceNon-empty stream read completely from offset zero; the original position is restored and the size must not exceed MaxInt
DisplayNameName shown for the embedded file; must not be empty and must not duplicate an existing embedded-file title
MIMETypeMIME type stored in the file specification; must not be empty
DescriptionOptional description stored in the associated-file entry; may be empty
RelationshipRelationship role, one of Source, Data, Alternative, Supplement or Unspecified

Return values

Returns a nonzero embedded-file handle on success or 0 on failure

Remarks

The complete stream is read from offset zero, the original position is restored, and the embedded parameters include size, checksum, and timestamps

The stream must be nonempty and no larger than MaxInt

See also

AddAssociatedFileFromFile, AddAssociatedFileFromString