IFileData.LoadFromStream(String, Stream) Method
Loads the file data from a stream.
Namespace: DevExpress.Persistent.Base
Assembly: DevExpress.Persistent.Base.v18.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
fileName | String | A string that is the file name. |
stream | Stream | A Stream that is the file content. |
Remarks
You can use the LoadFromStream method to upload a file from a Stream into a FileData type property of a business object:
using(FileStream fs = File.OpenRead("D:\\screenshot.png")) {
Resume fileDataHolder = (Resume)View.CurrentObject;
if(fileDataHolder.File == null) {
fileDataHolder.File = View.ObjectSpace.CreateObject<FileData>();
}
fileDataHolder.File.LoadFromStream("screenshot.png", fs);
}
Here, FileData is a built-in class implementing the IFileData interface.
See Also