Need help with Lua script

You can share your Lua Scripts with everybody here.

Need help with Lua script

Postby norus » Fri Nov 04, 2011 2:31 pm

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.
norus
 
posts 11
 
joined Fri Nov 04, 2011 2:28 pm

Re: Need help with Lua script

Postby FTP » Mon Nov 07, 2011 11:25 am

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: viewtopic.php?f=6&t=32


2. See here: viewtopic.php?f=6&t=229
FTP
Site Admin
 
posts 1229
 
joined Tue Sep 29, 2009 6:09 am

Re: Need help with Lua script

Postby norus » Tue Nov 08, 2011 10:16 am

Thank you so much! I will try it all out.
norus
 
posts 11
 
joined Fri Nov 04, 2011 2:28 pm


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron