Ftp:upload([remote_name])method


Upload a file to the connected FTP server.

Parameters

[remote_name]

An optional string that contains the destination path and filename on the server.
If not provided, the file will be uploaded on the current FTP directory (See Ftp.currentdir) using the same filename.

Return value


Returns true if uploading to the FTP server was successful, or false otherwise.
This method return a Task instance. Once the Task has finished, it will return a boolean value indicating if the operation was successful.

Example

--! luart-extensions import net -- connect to the FTP server local url = "your ftp server" local client = net.Ftp(url, "username", "password") -- upload file "test.txt" if await(client:upload(File("test.txt"))) then print("Successfully uploaded 'test.txt' to "..url) else error(net.error) end