24.03.2024, 17:29
Dear all,
on the advice of the Italian distributor I open this new thread on a topic already partially covered.
I have two LM5 Lite (fw 20240219) on my desktop connected to the same switch, on the first LM I run the client code (scripting/scheduled) you see below and I use the second as an FTP server.
With the FTP server without encryption mode, I remove the two parameters secure = true and datasecure = true from the client code and I can transfer a 2 MB .csv file without problems from the first LM to the other.
If I enable Require Encryption FTPS mode on the server and re-enable the two parameters secure/datasecure on the first LM, I can only transfer small size file (< 8 KB) otherwise I receive a 426 Failure reading network stream error and the file is truncated on the server.
If I use a generic FTPS client like Filezilla or WinSCP I can transfer files of any size on the second LM without error.
Over the weekend I tried to understand more but all I got was a headache...
on the advice of the Italian distributor I open this new thread on a topic already partially covered.
I have two LM5 Lite (fw 20240219) on my desktop connected to the same switch, on the first LM I run the client code (scripting/scheduled) you see below and I use the second as an FTP server.
With the FTP server without encryption mode, I remove the two parameters secure = true and datasecure = true from the client code and I can transfer a 2 MB .csv file without problems from the first LM to the other.
If I enable Require Encryption FTPS mode on the server and re-enable the two parameters secure/datasecure on the first LM, I can only transfer small size file (< 8 KB) otherwise I receive a 426 Failure reading network stream error and the file is truncated on the server.
If I use a generic FTPS client like Filezilla or WinSCP I can transfer files of any size on the second LM without error.
Over the weekend I tried to understand more but all I got was a headache...
Code:
ftp = require('socket.ftp')
ltn12 = require('ltn12')
host = 'xxx.xxx.xxx.xxx'
user = 'xxx'
pass = 'xxx'
data = io.readfile('/data/ftp/testfile.txt')
path = ('/testfile.txt')
res, err = ftp.put({
host = host,
user = user,
password = pass,
argument = path,
type = "a",
secure = true, -- Remove with FTP Server without encryption
datasecure = true, -- Remove with FTP Server without encryption
source = ltn12.source.string(data)
})
if not res then
alert('FTP upload error: %s', tostring(err))
end