Not allow to create sub directory

Please post here if you have problems in using Wing FTP Server.
Post Reply
sinha_roop
Posts: 7
Joined: Mon Jul 09, 2012 10:36 am

Not allow to create sub directory

Post by sinha_roop »

I am back after a month.
I have two questions:
A. I want to set restriction by which user are allowed to create directory but not allow to create sub directory. How can i do this?
Please suggest.

B. When user creates folder , automatic convert into upper case. Any idea?
Please suggest.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Not allow to create sub directory

Post by FTP »

Hi,

You can use lua script in the event "OnDirCreated". Here are some hints:
User the variable "%LastDir" will get the physical path of the folder you created. like: C:/FTP/Sinha/newfolder
Then Q2 is simple.
Q1 maybe a little complex. You can use c_GetUser to get the user information, then add a subdir rule and use c_AddUser to overwrite the user's exist settings.

local user = c_GetUser("%Domain", "%Name")
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end

//add a subdir rule here, this parameter is a table

c_AddUser("%Domain",user.username,user.password,user.protocol_type,..............)

Please try to complete it.
Post Reply