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:
[BrowsableAttribute(false)]
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.

.NET Framework
Available since 2.0
Return to top
Show: