Need help with Lua script

You can share your Lua Scripts with everybody here.
Post Reply
norus
Posts: 11
Joined: Fri Nov 04, 2011 2:28 pm

Need help with Lua script

Post by norus »

Hi all,

I'm a Java programmer, but I never used Lua. We are thinking about buying WingFTP, but these are some of the features that we need:

1. Have email notifications be sent when a file is either uploaded to or downloaded from the ftp server? The notification should at a minimum specify the file and folder names as well as the date/time and which user made the transfer. We need to be able to specify different email addresses for different folders.

It would also be nice to get regular summary reports (weekly/monthly) that shows a list of who has uploaded and download which file(s).

2. The ability to set expiry dates on files or folders so that they don't stay on the server for decades or would 'cleaning up' be a manual procedure.

Is this doable at all?

Thanks.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Need help with Lua script

Post by FTP »

1. Yes, for file uploading, you just need to add a simple script to the event "OnFileUploaded":

Code: Select all

if string.find("%PathName","d:/Subdir1") then
    c_SendMail("test111@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG")
elseif string.find("%PathName","d:/Subdir2") then
    c_SendMail("test222@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG")
elseif string.find("%PathName","d:/Subdir3") then
    c_SendMail("test333@test.com","a file has been uploaded","%Name uploaded into  %PathName","","SMTP_CONFIG")
end
About regular summary reports, maybe you could have a look on this post: http://www.wftpserver.com/bbs/viewtopic.php?f=6&t=32" rel="nofollow


2. See here: http://www.wftpserver.com/bbs/viewtopic.php?f=6&t=229" rel="nofollow
norus
Posts: 11
Joined: Fri Nov 04, 2011 2:28 pm

Re: Need help with Lua script

Post by norus »

Thank you so much! I will try it all out.
Post Reply