move File in LUA

Please post here if you have problems in using Wing FTP Server.
Post Reply
Curtis Newton2
Posts: 1
Joined: Tue Oct 11, 2011 7:53 am

move File in LUA

Post by Curtis Newton2 »

Hi,

I try to move files when a user logs on. My script is:

Code: Select all

if ("%Name" == "uploader") then
   mv C:\ftproot\Users\uploader\uploads\*.* C:\ftproot\Users\uploader
end
But this do not compile. Where is the error?

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

Re: move File in LUA

Post by FTP »

If you are running Windows system, maybe you can use the following lua script:

Code: Select all

if ("%Name" == "uploader") then
	local cmd = "move /y \"C:\\/ftproot\\/Users\\/uploader\\/uploads\\/*\" \"C:\\/ftproot\\/Users\\/uploader\""
	os.execute(cmd)
end
Post Reply