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
)
Function Stream (
Optional writeMode As Boolean = false
) As Stream
Stream^ Stream(
bool writeMode = false
)
abstract Stream :
?writeMode : bool
(* Defaults:
let _writeMode = defaultArg writeMode false
*)
-> Stream
Parameters
- writeMode (Optional)
- Type: SystemBoolean
Determines whether the retrieved Stream can be written to. Defaults to false.
Return Value
Type:
StreamStream of the associated file.
Examples
Example of using Stream in a custom hook:
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