Sample code for 30+ languages & platforms
Lua

Create Directory on FTP Server

See more FTP Examples

_LANGUAGE_ example showing how to create a new directory on an FTP site.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.

local ftp = chilkat.Ftp2.new()

ftp.hostname = "ftp.example.com"
ftp.username = "login"
ftp.password = "password"

-- Connect and login to the FTP server.
local success = ftp:connect()
if not success then
    print(ftp.last_error_text)
    return
end

-- Create a new directory on the FTP server:
success = ftp:create_remote_dir("newDirName")
if not success then
    print(ftp.last_error_text)
    return
end

success = ftp:disconnect()