Accepting File Uploads

The FileUpload control enables users to upload files to your web application. After the file is uploaded, you can store the file anywhere you please. Normally, you store the file either on the file system or in a database. This section explores both options.

The FileUpload control supports the following properties (this is not a complete list):

Enabled Enables you to disable the FileUpload control.

FileBytes Enables you to get the uploaded file contents as a byte array.

FileContent Enables you to get the uploaded file contents as a stream.

FileName Enables you to get the name of the file uploaded.

HasFile Returns True when a file has been uploaded.

PostedFile Enables you to get the uploaded file wrapped ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.