BeforeDownloadFile Event
Notifies about an incoming file download request.
Syntax
public event OnBeforeDownloadFileHandler OnBeforeDownloadFile; public delegate void OnBeforeDownloadFileHandler(object sender, FtpserverBeforeDownloadFileEventArgs e); public class FtpserverBeforeDownloadFileEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public long RestartAt { get; } public int Action { get; set; } }
Public Event OnBeforeDownloadFile As OnBeforeDownloadFileHandler Public Delegate Sub OnBeforeDownloadFileHandler(sender As Object, e As FtpserverBeforeDownloadFileEventArgs) Public Class FtpserverBeforeDownloadFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public ReadOnly Property RestartAt As Long Public Property Action As Integer End Class
Remarks
The component fires this event to notify the application about a received download request. ConnectionID identifies the connected client.
Set Action to fraAuto to let the server handle the request automatically, or to fraCustom to handle the request in your code. Subscribe to DownloadFile to be notified when to perform the request. It is the DownloadFile event handler where you should perform the overridden action.
Upon completion of the request, either in manual or override mode, the TransferCompleted event will be fired.
Choose Action as one of the following values:
fraAuto | 1 | Handle the requested action automatically by the server |
fraCustom | 2 | Override the action using the user code logic |
fraAbort | 3 | Abort the requested action |