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.3.169
Syntax
Stream Stream(
	bool writeMode = false
)

Parameters

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

Return Value

Type: Stream
Stream of the associated file.
Examples
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