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.
Variables in Access Rules
-
- Site Admin
- Posts: 2082
- Joined: Tue Sep 29, 2009 6:09 am
Re: Variables in Access Rules
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