Able to copy from IDE, but "Can't open data connection" from the command line.

Advertisement

Dan Curious
Donor
Joined:
Posts:
44
Location:
NY

Able to copy from IDE, but "Can't open data connection" from the command line.

Hi,

We're using WinSCP 5.11.3, build 7995

We have an FTP site e.g.
ourftpsite.ouragency.com, port 21
and we can send files to the /home/ folder via the ide.

But we're not able to use a batch file to send it.

Our batch file, OUR_Weekly.CMD, is
@ECHO OFF
 
CD "C:\scripts"
 
winscp.com /script=OUR_Weekly.txt /log="C:\LOGS\OUR_WEEKLY.LOG" /loglevel=0*
 
exit
OUR_Weekly.txt is
open ftp://OurUser:OurPassword@ourftpsite.ouragency.com/
 
put D:\inetpub\FTPROOT\apps\ourweekly\ourweekly.zip /home/
 
exit
, and the errors are
. 2021-04-13 16:46:47.942 Starting upload of D:\inetpub\FTPROOT\apps\ourweekly\ourweekly.zip
> 2021-04-13 16:46:47.942 CWD /home
< 2021-04-13 16:46:47.957 250 CWD successful. "/home" is current directory.
> 2021-04-13 16:46:47.957 PWD
< 2021-04-13 16:46:48.004 257 "/home" is current directory.
> 2021-04-13 16:46:48.004 TYPE I
< 2021-04-13 16:46:48.035 200 Type set to I
> 2021-04-13 16:46:48.035 PASV
< 2021-04-13 16:46:48.067 227 Entering Passive Mode (64,128,232,111,199,137)
> 2021-04-13 16:46:48.067 STOR ourweekly.zip
. 2021-04-13 16:46:48.067 Connecting to 64.128.232.111:51081 ...
< 2021-04-13 16:46:58.971 425 Can't open data connection for transfer of "/home/ourweekly.zip"
. 2021-04-13 16:46:58.971 Copying files to remote side failed.
* 2021-04-13 16:46:58.971 (ExtException) **Copying files to remote side failed.**
* 2021-04-13 16:46:58.971 Can't open data connection for transfer of "/home/ourweekly.zip"
. 2021-04-13 16:46:58.971 Asking user:
. 2021-04-13 16:46:58.971 Error transferring file 'D:\inetpub\FTPROOT\apps\ourweekly\ourweekly.zip'. ("Copying files to remote side failed.","Can't open data connection for transfer of ""/home/ourweekly.zip""")
< 2021-04-13 16:46:58.971 Script: Error transferring file 'D:\inetpub\FTPROOT\apps\ourweekly\ourweekly.zip'.
< 2021-04-13 16:46:58.971 Script: Copying files to remote side failed.
 
< 2021-04-13 16:46:58.971 Can't open data connection for transfer of "/home/ourweekly.zip"
* 2021-04-13 16:46:58.971 (EScpSkipFile) Error transferring file 'D:\inetpub\FTPROOT\apps\ourweekly\ourweekly.zip'.
* 2021-04-13 16:46:58.971 Copying files to remote side failed.
* 2021-04-13 16:46:58.971 Can't open data connection for transfer of "/home/ourweekly.zip"
. 2021-04-13 16:46:58.971 Copying finished: Transferred: 0, Elapsed: 0:00:11, CPS: 0/s
. 2021-04-13 16:46:58.971 Script: Failed
. 2021-04-13 16:46:58.971 Script: Exit code: 1
. 2021-04-13 16:46:58.987 Disconnected from server

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Able to copy from IDE, but "Can't open data connection" from the command line.

Please attach complete session log files both from the successful upload from IDE and the failed upload from the script. Consider using the latest version of WinSCP for both.

Reply with quote

Dan Curious
Donor
Joined:
Posts:
44
Location:
NY

Hi Martin,

Thanks, but I'm nervous about trying to mask server name and credentials in the log file, and afraid I might miss something.

Everything's fine, now. I found out about your feature to auto-generate the command-line script from Transfer Settings. There were a couple of glitches, but they were easy to figure out.

T & R,

Reply with quote

Advertisement

You can post new topics in this forum