Page 1 of 1

Variables in Access Rules

Posted: Thu Jun 23, 2016 5:03 pm
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.

Re: Variables in Access Rules

Posted: Sat Jun 25, 2016 6:18 am
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