16.01.2023, 14:03
(19.09.2022, 07:43)Gadjoken Wrote: Hello,
Can you confirm that this script by erwin Van der Zwart that i adapted allows you to send all the trends to a remote FTP server?
Code:src = 'Trend Export '.. os.date('%Y-%m-%d %H#%M#%S') .. '.csv'
dst = '/home/ftp/' .. src
io.writefile(dst, buffer)
local ftp = require("socket.ftp")
local ltn12 = require("ltn12")
-- Indiquer le dossier du serveur FTP dans lequel vous souhaitez mettre le fichier CSV des courbes
target = '/EXPORT/Courbes/' .. src
--Indiquer HOST / USER / PASSWORD
f, e = ftp.put{
host = "192.168.54.246",
user = "FTP-User",
password = "my_password",
type = "i",
argument = target,
source = ltn12.source.file(io.open(dst, "rb"))
}
if (e) then
log (e)
log (f)
alert("Could not ftp: ", e, "\n")
end
log("ftp_trends")
os.remove(dst)
Thank you for your understanding.
Best regards.
Hi
I am doing the same here on an ftp I have set up. I can modify the directories and add files from remote computer with the user I have set up, but when I try to write from SL I get "550 Permission denied". Any idea why?
I have disabled the FW on the remote computer. I get no error when connecting (tried with wrong user/pw, and then I get the expected login-failure).
There are 10 kinds of people in the world; those who can read binary and those who don't