DownloadFile Event
An override for a file download initiation operation.
Syntax
public event OnDownloadFileHandler OnDownloadFile; public delegate void OnDownloadFileHandler(object sender, FtpserverDownloadFileEventArgs e); public class FtpserverDownloadFileEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public long RestartAt { get; } public int OperationStatus { get; set; } }
Public Event OnDownloadFile As OnDownloadFileHandler Public Delegate Sub OnDownloadFileHandler(sender As Object, e As FtpserverDownloadFileEventArgs) Public Class FtpserverDownloadFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public ReadOnly Property RestartAt As Long Public Property OperationStatus As Integer End Class
Remarks
The component fires this event to let the application perform an overridden file download initiation operation.
This event only fires if Action = fraCustom was passed back from BeforeDownloadFile event, and expects your code to perform the requested operation inside the handler. No default operation will be performed by the server component.
Use the OperationStatus parameter to return the operation result back to the server.
This event will be followed by a number of ReadFile calls, requesting the file data from your code, followed by a single TransferCompleted call.
Set OperationStatus to one of the following values:
ostOk | 1 | |
ostNoSuchFile | 2 | |
ostAccessDenied | 3 | |
ostWriteProtect | 4 | |
ostUnsupported | 5 | |
ostInvalidParameter | 6 | |
ostEOF | 7 |