Back to product page

DownloadFile event


Fires when user wants to download file.

Syntax

  • Basic
Private Sub object_DownloadFile(User, RelativePath, ResolvedPath, Action)
The DownloadFile(object,User,RelativePath,ResolvedPath,Action) syntax has these parts:
objectAn expression evaluating to an object of type wodFTPD.
UserA FtpUser object. Reference to use who wants to download file.
RelativePathA String value. Path to the file, as seen by the user.
ResolvedPathA String value. Full path to the file on local system.
ActionA FtpActions enumeration, as described in settings. When set to Deny/SilentDeny, wodFTPServer denies this action.

Remarks

DownloadFile event is fired when connected users tries to download file. Inside this event, you get relative path to filename as seen by the client. wodFTPServer internally (using HomeDir property) tries to resolve this file and provides ResolvedPath argument that points to actual file on disk that will be downloaded. At this point you can change ResolvedPath argument to something completely different - and cause client to download something else without seeing any difference.

If you set Action = Deny, then client will receive 'permission denied' error and will not be able to download the file.

The settings for Action are
Constant Value Description
Deny0 Deny execution of the action.
Allow 1 Allow to execute action.
SilentDeny2 Silently deny execution of the action.
SilentAllow 3 Silently allow to execute action.

Platforms

Windows