Platform SDK: Broadcast Architecture

IATVEFPackage::AddFile

Adds a file to an existing package that was created with Initialize.

HRESULT AddFile(
  LPOLESTR szFilename,
  LPOLESTR szMIMEContentLocation,
  LPOLESTR szMIMEContentType,
  DATE ExpiresDate,
  LONG MIMEContentLanguageId,
  BOOL fCompress
);

Parameters

szFilename
File name of the file to be added.
szMIMEContentLocation
File's namespace on the client.
szMIMEContentType
MIME type of the file.
ExpiresDate
Expiration date and time for this file. If set to zero, no "Expires" field will be written to the header for this particular file (see Remarks).
MIMEContentLanguageId
Language in which this session's content is presented.
fCompress
Boolean indicating whether to apply gzip compression to this file.

Return Value

Returns S_OK if the method succeeds; otherwise, an error code is returned.

Remarks

The content-location parameter refers to an "lid://" namespace in the client's cache that can be used to group files according to unique local identifiers. When a trigger is sent, it can reference this same namespace to tell the client where to look for the file being invoked.

The specification requires all packages as well as the individual files they contain to be preceded by an HTTP-style header. If the ExpiresDate parameter contains a valid date, the component will use it to write the "Expires" field in that header for this particular file. If this value is set to zero, the "Expires" field will not be written at all. See Creating An Announcement for an example of how to create a DATE variable.

For further information on MIME content attributes and HTTP-style headers for resources, see the ATVEF specification.

This method will fail if you attempt to add files to a package that has not yet been created using Initialize, or that has been closed with the Close method.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 98.
  Header: Declared in atvefsnd.idl.
  Import Library: Included as a resource in atvefsnd.dll.

See Also

Sending Announcements, Packages, and Triggers