Back to Devexpress

UploadedFile.FileContent Property

aspnet-devexpress-dot-web-dot-uploadedfile.md

latest2.0 KB
Original Source

UploadedFile.FileContent Property

Gets a stream object that points to the uploaded file.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public Stream FileContent { get; }
vb
Public ReadOnly Property FileContent As Stream

Property Value

TypeDescription
Stream

A Stream object that points to the uploaded file.

|

Remarks

Uploading the file specified within the ASPxUploadControl can be initiated either by a call to the client ASPxClientUploadControl.Upload method, or automatically on the next round trip to the server (for instance, on a button click or page refresh). On the server side, while saving the uploaded file, the FileContent property can be used to access the file’s contents.

Important

To prevent the site performance degradation, it is required to release unmanaged resources after using the FileContent property. To do this, you can utilize the using statement or Dispose method.

csharp
using (Stream stream = e.UploadedFile.FileContent) {
     // do something with stream
}

See Also

FileBytes

FileName

ContentLength

ContentType

UploadedFile Class

UploadedFile Members

DevExpress.Web Namespace