UploadedFileSaveAs Method (String) |
Saves the contents of an uploaded file.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax public void SaveAs(
string fileName
)
Public Sub SaveAs (
fileName As String
)
public:
void SaveAs(
String^ fileName
)
member SaveAs :
fileName : string -> unit
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++)
{
TempFileName = "C:\\TempFiles\\File_" + Loop1.ToString();
MyFileCollection[Loop1].SaveAs(TempFileName);
}
Dim Loop1 As Integer
Dim TempFileName As String
Dim MyFileCollection As UploadedFileCollection = KaxUpload1.UploadedFiles
For Loop1 = 0 To MyFileCollection.Count - 1
TempFileName = "C:\TempFiles\File_" & CStr(Loop1)
MyFileCollection(Loop1).SaveAs(TempFileName)
Next Loop1
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also