Skip to content

FTP

Name Input Params Return Data Description
resiot_ftp_createfile String, String, String, String String Create or overwrite a file in an FTP Server

resiot_ftp_createfile(String, String, String, String)

Create or overwrite a file in an FTP Server.
Example
Error = resiot_ftp_createfile(IdHex, Path, Name, Content)
Input Parameters
 - IdHex (String): * The IdHex of the FTP Server connection.
 - Path (String): * The Path of the FTP Server relative to the directory included in the FTP Server connection where the file will be created. If left blank the file will be created in the directory of the FTP Server connection. If the path does not exist an error will be returned.

 - Name (String): * The Name of the file with the extension. If the file already exists it wil be overwritten.
 - Content (String): * The Content of the file to create.

Returns
 - Error (String): * Blank if creation is successful, otherwise it contains the error. *

IdHex = "6d65643135"                -- The IdHex of the FTP Server connection
Path = "folder1/folder2"            -- The Path of the FTP Server where the file will be created
Name = "Testfile.txt"               -- The Name of the file with the extension
Content = "This is an example text" -- The Content of the file to create
Error = resiot_ftp_createfile(IdHex, Path, Name, Content)
if Error ~= "" then
    resiot_debug(Error)
end

Return to index