Hi,
I have the openfile event set and I used the default openfile event as a template.
My question is what would be the best way to determine if the file open is for upload or download?
Is checking if blockmode is bmRead or bmwrite sufficient?
I want to raise erPermissionDenied if the user does not have Stor or Retr permissions as stored in my authentication DB.
Best way to determine if file operation is upload or download in SFTPServer?
Re: Best way to determine if file operation is upload or download in SFTPServer?
To define upload/download operation mode, you should handle the OpenAttributes.Mode property in the TScSFTPServer.OnOpenFile event handler. For example:
Code: Select all
if OpenAttributes.Mode in [fmOpenExisting] then
OperationMode := 'Download'
else
OperationMode := 'Upload';