public override void MoveTo(string path, MoveToOptions opts) { if (opts.CanOverwrite && System.IO.File.Exists(path)) { System.IO.File.Delete(path); } File.SaveAs(path); }
/// <summary> /// If called, this stream is considered "verified" and is allowed to stay in the datadase. If this is never called, the row is deleted /// </summary> /// <param name="path"><c>Optional</c> If specified, and the target data table has a FileNameField specified, the filename is changed. If <c>null</c> the filename remains the same</param> /// <param name="opts">Ignored</param> /// <remarks>This slightly aquard behaviour is due to the NeatUpload framework, where "MoveTo" is the only suitable method exposed by InputFile</remarks> public override void MoveTo(string path, MoveToOptions opts) { _verified = true; //Change filename in the database if (path != null && ( (_provider.FileNameColumnName != null && _provider.FileNameColumnName.Length > 0) || (_provider.RenameProcedure != null && _provider.RenameProcedure.Length > 0))) { Rename(path); } }