KaxUploadFileExists Event |
Occurs after an unsuccessful attempt for automatic saving of a file in the
UploadedFiles collection.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic event UploadedFileEventHandler FileExists
Public Event FileExists As UploadedFileEventHandler
public:
event UploadedFileEventHandler^ FileExists {
void add (UploadedFileEventHandler^ value);
void remove (UploadedFileEventHandler^ value);
}
member FileExists : IEvent<UploadedFileEventHandler,
UploadedFileEventArgs>
Value
Type:
Kettic.AspNet.Controls.UploadUploadedFileEventHandler
Remarks
This event should be consumed only when the automatic file saving is enabled by
setting the TargetFolder property. In this mode
the files are saved in the selected folder with the same name as on the client
computer. If a file with such name already exists in the
TargetFolder it is either overwritten or skipped
depending the value of the
OverwriteExistingFiles property. This
event is fired if
OverwriteExistingFiles is set to
false and a file with the same name already exists in the
TargetFolder.
Examples
This example demostrates how to create custom logic for renaming and saving the
existing uploaded files.
private void KaxUpload1_FileExists(object sender, Kettic.AspNetControls.UploadedFileEventArgs e)
{
Kettic.AspNetControls.UploadedFile TheFile = e.UploadedFile;
TheFile.SaveAs(Path.Combine(KaxUpload1.TargetFolder, TheFile.GetNameWithoutExtension() + "1" + TheFile.GetExtension()), true);
}
Private Sub KaxUpload1_FileExists(ByVal sender As Object, ByVal e As WebControls.UploadedFileEventArgs) Handles KaxUpload1.FileExists
Dim TheFile As Kettic.AspNetControls.UploadedFile = e.UploadedFile
TheFile.SaveAs(Path.Combine(KaxUpload1.TargetFolder, TheFile.GetNameWithoutExtension() + "1" + TheFile.GetExtension()), true)
End Sub
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