HttpPostedFile::SaveAs Method
Saves the contents of an uploaded file.
Assembly: System.Web (in System.Web.dll)
Parameters
- filename
- Type: System::String
The name of the saved file.
| Exception | Condition |
|---|---|
| HttpException | The RequireRootedSaveAsPath property of the HttpRuntimeSection object is set to true, but filename is not an absolute path. |
The maximum size allowed for a request, which includes uploaded files, is 4 MB, by default. Maximum request size can be specified in the Machine.config or Web.config file in the maxRequestLength attribute of the httpRuntime Element (ASP.NET Settings Schema) element. The maximum request size for a specific page can be specified using the location Element (ASP.NET Settings Schema) element in a Web.config file.
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.