07-23-2023, 04:26 AM
I am trying to upload a text file to FTP server using a batch file. It logins successfully and shows
> Port command sent successfully
but after that shows
> Could not open data connection to port xxxx
> Connection timed out
This is the batch script:
@echo off
for %%A in (*.csv) do set latest=%%A
echo Latest file is %latest%
echo MYUSERNAME> upload.txt
echo MYPASSWORD>> upload.txt
echo asc>>upload.txt
echo put %latest% s.txt>> upload.txt
echo quit >> upload.txt
ftp -s:upload.txt server58.hostinger.in
> Port command sent successfully
but after that shows
> Could not open data connection to port xxxx
> Connection timed out
This is the batch script:
@echo off
for %%A in (*.csv) do set latest=%%A
echo Latest file is %latest%
echo MYUSERNAME> upload.txt
echo MYPASSWORD>> upload.txt
echo asc>>upload.txt
echo put %latest% s.txt>> upload.txt
echo quit >> upload.txt
ftp -s:upload.txt server58.hostinger.in