This documentation is archived and is not being maintained.

FileUpload::FileContent Property

Gets a Stream object that points to a file to upload using the FileUpload control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[BrowsableAttribute(false)]
public:
property Stream^ FileContent {
	Stream^ get ();
}

Property Value

Type: System.IO::Stream
A Stream that points to a file to upload using the FileUpload.

The FileContent property gets a Stream object that points to a file to upload by using the FileUpload control. Use the FileContent property to access the contents of the file. For example, you can use the Stream object that is returned by this property to read the contents of the file as bytes and store them in a byte array.

The following example demonstrates how to create a FileUpload control. The FileContent property is used to read the contents of the file into a byte array. When the user clicks the Upload file button, the contents of the file are displayed as bytes in a text box on the page.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: