LUA Script OnFileUpload to exclude specific user account

You can share your Lua Scripts with everybody here.
Post Reply
diskonekted
Posts: 2
Joined: Thu Nov 22, 2012 1:40 am

LUA Script OnFileUpload to exclude specific user account

Post by diskonekted »

Hi all,

As the subject suggests, I've got a basic LUA script that executes when an OnFileUpload event occurs. The code simply takes a copy of the uploaded file and retains this as a backup for auditing purposes.

The problem I have is that I want this to exctue for all users, execpt one. From what I can tell there is no method through the WingFTP GUI to do this, so I was wondering about an exception within the script; something like:

if <current upload user> == "FTP-Test"

end

elseif

<do rest of calculation>

I can't seem to locate if there is any function to determine the current account that it is performing actions via LUA; maybe I'm just looking at it the wrong way......

Thanks in advance, need coffee.....
diskonekted
Posts: 2
Joined: Thu Nov 22, 2012 1:40 am

Re: LUA Script OnFileUpload to exclude specific user account

Post by diskonekted »

So after messing around for an hour or so, I realised that the parameter that I need is simply "%Name".

so the line reads now as:

if "%Name" == "FTP-test" then
<do something>
end

Hopefully someone else can save their time by using the above info.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: LUA Script OnFileUpload to exclude specific user account

Post by FTP »

Yes, you are right, and if you have thousands of users, you can also mark some data fields for the specific user account, like this: http://www.wftpserver.com/bbs/viewtopic.php?f=4&t=2852" rel="nofollow
Post Reply