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)

public:
property Stream^ FileContent {
	Stream^ get ();
}
/** @property */
public Stream get_FileContent ()

public function get FileContent () : Stream

Not applicable.

Property Value

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 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 code 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 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: