Variables in Access Rules

Please post here if you have problems in using Wing FTP Server.
Post Reply
Coreyg
Posts: 1
Joined: Thu Jun 23, 2016 4:52 pm

Variables in Access Rules

Post by Coreyg »

Hi,
Is it possible to add variables to the File access rules? I would like there to be a limitation which prevents users from uploading content with a date other than today"s date. As an example the file can be called abc20160601.txt. So my variable would be abc%Year%MM%DD.txt. Therefore, everyday date value in the access rule will change to only allow a file which contains today's date.
Is this possible? Should I be considering changing the value in the database table_filemask?


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

Re: Variables in Access Rules

Post by FTP »

If you want to block the specified uploaded file, you can use the event "OnFileUploaded" to delete the uploaded files, you can use the following Lua script:

Code: Select all

local filename = string.gsub("%PathName", "\\","/")

if string.sub(filename,1, 3) == "abc" then 
	c_RemoveFileDir("%PathName")
end 
Post Reply