Error uploading a file from a .bat
Posted: 2021-02-22 18:38
Hi I created a .bat file to upload a file directly to a server.
This is the code that I have:
It connects to the server perfectly.
Then it says that the connection is being made to upload the file and stays in that step.
"In the ftp of the server put this information:
230 Logged on
PORT 83,54,203,226,196,4
200 Port command successful
STOR diaverso-20210221133120.rar
150 Opening data channel for file upload to server of "/diaverso-20210221133120.rar"
425 Can't open data connection for transfer of "/diaverso-20210221133120.rar"
421 Connection timed out."
With the filezilla client program I can upload the files without any problem.
I attach a video to see the steps.
https://www.youtube.com/watch?v=xPDlI01aQ0Q
I do not understand why the connection is closed ...
This is the code that I have:
Code: Select all
@echo off
echo user usuario> ftpcmd.dat
echo pass>> ftpcmd.dat
echo lcd H:\>> ftpcmd.dat
echo put *.rar>> ftpcmd.dat
ftp -n -s:ftpcmd.dat IP
del ftpcmd.dat
Then it says that the connection is being made to upload the file and stays in that step.
"In the ftp of the server put this information:
230 Logged on
PORT 83,54,203,226,196,4
200 Port command successful
STOR diaverso-20210221133120.rar
150 Opening data channel for file upload to server of "/diaverso-20210221133120.rar"
425 Can't open data connection for transfer of "/diaverso-20210221133120.rar"
421 Connection timed out."
With the filezilla client program I can upload the files without any problem.
I attach a video to see the steps.
https://www.youtube.com/watch?v=xPDlI01aQ0Q
I do not understand why the connection is closed ...