how to get one file

Advertisement

wanm
Guest

how to get one file

i can getfiles by wildcard,but if set fullfath and filename,seem it can't work

TransferOperationResult transferResult;
transferResult = session.GetFiles("/Article/a.asp", "E:\\download\\");
transferResult.Check();


log:
2016-07-23 09:58:53.939 Listing file "/Article/a.asp".
. 2016-07-23 09:58:53.940 Retrieving file information...
> 2016-07-23 09:58:53.940 MLST /Article/a.asp
< 2016-07-23 09:58:53.945 502 Command not implemented.
. 2016-07-23 09:58:53.945 Could not retrieve file information
< 2016-07-23 09:58:53.945 Script: Can't get attributes of file '/Article/a.asp'.
< 2016-07-23 09:58:53.945 Could not retrieve file information

< 2016-07-23 09:58:53.946 Command not implemented.
. 2016-07-23 09:58:53.946 Script: Failed
> 2016-07-23 09:58:54.029 Script: exit
. 2016-07-23 09:58:54.029 Script: Exit code: 1

Reply with quote

Advertisement

bob777
Guest

how to use "get" to download a file

Can't get the file to download


the log file

. 2016-10-14 13:41:10.059 --------------------------------------------------------------------------
. 2016-10-14 13:41:10.059 WinSCP Version 5.9.2 (Build 6958) (OS 6.1.7601 Service Pack 1 - Windows 7 Ultimate)
. 2016-10-14 13:41:10.059 Configuration: C:\Users\Dream3\Desktop\WinSCP.ini
. 2016-10-14 13:41:10.059 Log level: Normal
. 2016-10-14 13:41:10.059 Local account: WIN-01513Q2KT2R\Dream3
. 2016-10-14 13:41:10.059 Working directory: C:\Users\Dream3\Desktop
. 2016-10-14 13:41:10.059 Process ID: 3524
. 2016-10-14 13:41:10.059 Command-line: winscp.exe /console /script=test.txt /log=C:\Users\Dream3\Desktop\winscp.log
. 2016-10-14 13:41:10.059 Time zone: Current: GMT-7 (US Mountain Standard Time), No DST
. 2016-10-14 13:41:10.059 Login time: Friday, October 14, 2016 1:41:10 PM
. 2016-10-14 13:41:10.059 --------------------------------------------------------------------------
. 2016-10-14 13:41:10.059 Script: Retrospectively logging previous script records:
> 2016-10-14 13:41:10.059 Script: option batch on
< 2016-10-14 13:41:10.059 Script: batch on
< 2016-10-14 13:41:10.059 Script: reconnecttime 120
> 2016-10-14 13:41:10.059 Script: option confirm off
< 2016-10-14 13:41:10.059 Script: confirm off
> 2016-10-14 13:41:10.059 Script: open ftp://"MY USER":***@"MY FTP SITE"
. 2016-10-14 13:41:10.059 --------------------------------------------------------------------------
. 2016-10-14 13:41:10.059 Session name: "MY FTP SITE" (Ad-Hoc site)
. 2016-10-14 13:41:10.059 Host name: a"MY FTP SITE" (Port: 21)
. 2016-10-14 13:41:10.059 User name: "MY USER" (Password: Yes, Key file: No)
. 2016-10-14 13:41:10.059 Transfer Protocol: FTP
. 2016-10-14 13:41:10.059 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2016-10-14 13:41:10.059 Disable Nagle: No
. 2016-10-14 13:41:10.059 Proxy: None
. 2016-10-14 13:41:10.059 Send buffer: 262144
. 2016-10-14 13:41:10.059 UTF: Auto
. 2016-10-14 13:41:10.059 FTPS: None [Client certificate: No]
. 2016-10-14 13:41:10.059 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2016-10-14 13:41:10.059 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-10-14 13:41:10.059 Cache directory changes: Yes, Permanent: Yes
. 2016-10-14 13:41:10.059 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2016-10-14 13:41:10.059 Timezone offset: 0h 0m
. 2016-10-14 13:41:10.059 --------------------------------------------------------------------------
. 2016-10-14 13:41:10.059 Connecting to "MY LOGIN INFO" ...
. 2016-10-14 13:41:10.231 Connected with "MY LOGIN INFO". Waiting for welcome message...
< 2016-10-14 13:41:10.293 220 Service ready for new user.
> 2016-10-14 13:41:10.293 USER "MY USER"
< 2016-10-14 13:41:11.557 331 User name okay, need password for "MY USER".
> 2016-10-14 13:41:11.557 PASS *********
< 2016-10-14 13:41:12.321 230 User logged in, proceed.
> 2016-10-14 13:41:12.321 SYST
< 2016-10-14 13:41:12.399 215 UNIX Type: Apache FtpServer
> 2016-10-14 13:41:12.399 FEAT
< 2016-10-14 13:41:12.461 211-Extensions supported
< 2016-10-14 13:41:12.461 SIZE
< 2016-10-14 13:41:12.461 MDTM
< 2016-10-14 13:41:12.461 REST STREAM
< 2016-10-14 13:41:12.461 LANG en;zh-tw;ja;is
< 2016-10-14 13:41:12.461 MLST Size;Modify;Type;Perm
< 2016-10-14 13:41:12.461 AUTH SSL
< 2016-10-14 13:41:12.461 AUTH TLS
< 2016-10-14 13:41:12.461 MODE Z
< 2016-10-14 13:41:12.461 UTF8
< 2016-10-14 13:41:12.461 TVFS
< 2016-10-14 13:41:12.461 MD5
< 2016-10-14 13:41:12.461 MMD5
< 2016-10-14 13:41:12.461 MFMT
< 2016-10-14 13:41:12.461 211 End
> 2016-10-14 13:41:12.461 OPTS UTF8 ON
< 2016-10-14 13:41:12.539 200 Command OPTS okay.
. 2016-10-14 13:41:12.539 Connected
. 2016-10-14 13:41:12.539 --------------------------------------------------------------------------
. 2016-10-14 13:41:12.539 Using FTP protocol.
. 2016-10-14 13:41:12.539 Doing startup conversation with host.
> 2016-10-14 13:41:12.539 PWD
< 2016-10-14 13:41:12.602 257 "/" is current directory.
. 2016-10-14 13:41:12.602 Getting current directory name.
. 2016-10-14 13:41:12.602 Startup conversation with host finished.
< 2016-10-14 13:41:12.602 Script: Active session: [1] "MY LOGIN INFO"
> 2016-10-14 13:41:12.602 Script: option transfer binary
< 2016-10-14 13:41:12.602 Script: transfer binary
> 2016-10-14 13:41:12.602 Script: get 13589_2345223_mp.xml.gz C:\Users\Dream3\Downloads
. 2016-10-14 13:41:12.602 Listing file "13589_2345223_mp.xml.gz".
. 2016-10-14 13:41:12.602 Retrieving file information...
> 2016-10-14 13:41:12.602 MLST /13589_2345223_mp.xml.gz
< 2016-10-14 13:41:12.680 501 Not a valid pathname.
. 2016-10-14 13:41:12.680 Could not retrieve file information
< 2016-10-14 13:41:12.680 Script: Can't get attributes of file '13589_2345223_mp.xml.gz'.
< 2016-10-14 13:41:12.680 Could not retrieve file information
< 2016-10-14 13:41:12.680 Not a valid pathname.
. 2016-10-14 13:41:12.680 Script: Failed
> 2016-10-14 13:41:12.680 Script: close
. 2016-10-14 13:41:12.680 Disconnected from server

Reply with quote

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

Re: how to use "get" to download a file

bob777 wrote:

Can't get the file to download
Can you download the file anyhow? Using WinSCP GUI? Or any other FTP client?
If you can, post a log file showing that.

Reply with quote

Advertisement

You can post new topics in this forum