AjaxControlToolkit.AjaxFileUpload.SaveAs C# (CSharp) Méthode

SaveAs() public méthode

Saves the uploaded file with the specified file name
public SaveAs ( string fileName ) : void
fileName string Name of the file to save
Résultat void
        public void SaveAs(string fileName)
        {
            var dir = Path.GetDirectoryName(_uploadedFilePath);

            // Override existing file if any
            if(File.Exists(fileName))
                File.Delete(fileName);

            File.Copy(_uploadedFilePath, fileName);
            File.Delete(_uploadedFilePath);

            // Delete temporary data
            Directory.Delete(dir);
        }