Page 1 of 1

Need help with Lua script

Posted: Fri Nov 04, 2011 2:31 pm
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.

Re: Need help with Lua script

Posted: Mon Nov 07, 2011 11:25 am
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

Re: Need help with Lua script

Posted: Tue Nov 08, 2011 10:16 am
by norus
Thank you so much! I will try it all out.