Manipulating the Uploaded Files
Server-side API provides a way to manipulate uploaded files - rename them, save them, etc.
Do not set TargetFolder or TargetPhysicalFolder if you intend to use server-side API to manipulate the uploaded files. If you use both methods you may end with two copies of the uploaded files.
If validation of files has been enabled, the uploaded files will be first validated. Then, the valid files can be accessed via the UploadedFiles collection, and the invalid files using the InvalidFiles collection.
Some important server-side properties of the UploadedFile class are:
- FileName - returns the full client-side path of the file (IE6 and some older browsers only)
To get equal behavior with all browsers you should use GetName() method to obtain the name of the uploaded file.
- GetName() - returns the name of the uploaded file
- SaveAs() - saves the uploaded file to the specified location