This documentation is archived and is not being maintained.

HttpPostedFile Class

Provides a way to access individual files that have been uploaded by a client.

For a list of all members of this type, see HttpPostedFile Members.


[Visual Basic]
NotInheritable Public Class HttpPostedFile
public sealed class HttpPostedFile
public __gc __sealed class HttpPostedFile
public class HttpPostedFile

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The HttpFileCollection class provides access to all the files uploaded from a client as a file collection. HttpPostedFile provides properties and methods to get information on an individual file and to read and save the file. Files are uploaded in MIME multipart/form-data format and are buffered in server memory until explicitly saved to disk.

The HtmlInputFile control can be used to select and upload files from a client.

You can specify the maximum allowable upload file size in a machine.config or Web.config configuration file in the maxRequestLength attribute of the <httpRuntime> Element element. The default is 4 megabytes.


Namespace: System.Web

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

HttpPostedFile Members | System.Web Namespace