Click or drag to resize
UploadedFileSaveAs Method (String)
Saves the contents of an uploaded file.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public void SaveAs(
	string fileName
)

Parameters

fileName
Type: SystemString
Remarks

The maximum allowed uploaded file size is 4MB by default. Maximum file size can be specified in the machine.config or Web.config configuration files in the maxRequestLength attribute of the <httpRuntime> element.

The ASP.NET process must have proper rights for writing on the folder where the files are saved.

Examples
The following example saves all the files uploaded by the client to a folder named "C:\TempFiles" on the Web server's local disk.
String TempFileName;
UploadedFileCollection MyFileCollection = KaxUpload1.UploadedFiles;

for (int Loop1 = 0; Loop1 < MyFileCollection.Count; Loop1++)
{
    // Create a new file name.
    TempFileName = "C:\\TempFiles\\File_" + Loop1.ToString();
    // Save the file.
    MyFileCollection[Loop1].SaveAs(TempFileName);
}
See Also