Click or drag to resize

IAssetStream Method


Retrieves a Stream for the file associated with the current version of the asset.

A Stream is a view of the bytes of the file.


Namespace: Ingeniux.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
Syntax
Stream Stream(
	bool writeMode = false
)

Parameters

writeMode  Boolean  (Optional)
Determines whether the retrieved Stream can be written to. Defaults to false.

Return Value

Stream
Stream of the associated file.
Example
Example of using Stream in a custom hook:
C#
var filePath = string.Format("c:\archive\{0}{1}", asset.Name);
using (FileStream fs = System.IO.File.Create(filePath)) 
{ 
    asset.Stream.Seek(0, SeekOrigin.Begin); 
    asset.Stream.CopyTo(fs); 
    fs.Flush(); 
    fs.Close(); 
}
See Also