Page 1 of 1

Send mail only in upload for a certain directory/User

Posted: Mon Aug 05, 2013 7:33 am
by Megalomaniac
Hello,

I would like to have a script that only sends a mail when an upload has been done to a certain folder. Can anybody help me with that I am really a newbie to this scripting.

Re: Send mail only in upload for a certain directory/User

Posted: Tue Aug 06, 2013 11:27 am
by FTP
You can use the following Lua script:

Code: Select all

local filepath = "%PathName"
local username = "%Name"
    
if username == "aa" and string.find(filepath,"d:/FolderA") then 
	c_SendMail("xxx@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG") 
elseif username == "bb" and string.find(filepath,"d:/FolderB") then 
	c_SendMail("yyy@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG") 
elseif username == "cc" and string.find(filepath,"d:/FolderC") then 
	c_SendMail("zzz@test.com","a file has been uploaded","%Name uploaded into  %PathName","","SMTP_CONFIG") 
end

Re: Send mail only in upload for a certain directory/User

Posted: Thu Sep 12, 2013 11:37 am
by Megalomaniac
Ok, I understand. Where do I need to enter that in WingFTP?

Re: Send mail only in upload for a certain directory/User

Posted: Mon Sep 16, 2013 7:29 am
by FTP
You just need to add that scripts into the "Event Manager -> FTP(HTTP/SSH) Events -> OnFileUploaded".