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.
Send mail only in upload for a certain directory/User
-
- Posts: 4
- Joined: Fri Oct 21, 2011 9:36 am
-
- Site Admin
- Posts: 2090
- Joined: Tue Sep 29, 2009 6:09 am
Re: Send mail only in upload for a certain directory/User
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
-
- Posts: 4
- Joined: Fri Oct 21, 2011 9:36 am
Re: Send mail only in upload for a certain directory/User
Ok, I understand. Where do I need to enter that in WingFTP?
-
- Site Admin
- Posts: 2090
- Joined: Tue Sep 29, 2009 6:09 am
Re: Send mail only in upload for a certain directory/User
You just need to add that scripts into the "Event Manager -> FTP(HTTP/SSH) Events -> OnFileUploaded".