This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

FTPS example
#22
Hi all,
same problem here with FTPS, file uploaded but 0 K

FTP upload error: closed

HW: LM5 Lite (i.MX6)
SW: 20230607

Any tips?

Code:
host = 'xxx'
user = 'xxx'
pass = 'xxx'

path = '/backup' .. os.date('%Y-%m-%d') .. '.gz'

ftp = require('socket.ftp')
ltn12 = require('ltn12')
webrequest = require('webrequest')
data = webrequest('general', 'backup')

res, err = ftp.put({
  host = host,
  user = user,
  password = pass,
  secure = true,     -- without this: FTP upload error: 530 Non-anonymous sessions must use encryption.
  datasecure = true, -- without this: FTP upload error: 522 Data connections must be encrypted.
  type = "a",        -- no luck with type = "a" or type = "i"
  argument = path,
  source = ltn12.source.string(data)
})

if not res then
  alert('FTP upload error: %s', tostring(err))
end
Reply


Messages In This Thread
FTPS example - by npinguin - 19.09.2017, 16:23
RE: Sftp example - by Erwin van der Zwart - 19.09.2017, 18:56
RE: Sftp example - by npinguin - 20.09.2017, 18:30
RE: Sftp example - by admin - 21.09.2017, 14:24
RE: Sftp example - by npinguin - 21.09.2017, 15:45
RE: Sftp example - by admin - 22.09.2017, 10:31
RE: Sftp example - by npinguin - 22.09.2017, 14:11
RE: FTPS example - by admin - 22.09.2017, 15:26
RE: FTPS example - by admin - 25.09.2017, 11:29
RE: FTPS example - by npinguin - 25.09.2017, 18:02
RE: FTPS example - by admin - 26.09.2017, 06:10
RE: FTPS example - by DGrandes - 22.02.2023, 14:37
RE: FTPS example - by admin - 23.02.2023, 06:39
RE: FTPS example - by Kilogica - 13.03.2024, 09:08
RE: FTPS example - by Daniel - 13.03.2024, 09:39
RE: FTPS example - by admin - 13.03.2024, 10:10
RE: FTPS example - by Kilogica - 13.03.2024, 11:27
RE: FTPS example - by Daniel - 13.03.2024, 11:29
RE: FTPS example - by Kilogica - 13.03.2024, 11:47
RE: FTPS example - by Daniel - 13.03.2024, 12:11
RE: FTPS example - by Kilogica - 13.03.2024, 13:51
RE: FTPS example - by ferrim - 20.03.2024, 08:28
RE: FTPS example - by admin - 20.03.2024, 08:34
RE: FTPS example - by ferrim - 20.03.2024, 08:53
RE: FTPS example - by ferrim - 22.03.2024, 08:42
RE: FTPS example - by admin - 22.03.2024, 08:54
RE: FTPS example - by ferrim - 22.03.2024, 09:21

Forum Jump: