How to get .csv file from the Https url?

Advertisement

MZL
Guest

How to get .csv file from the Https url?

Hi.
I cannot get .csv file from the https server though script.

Please confirm below script:

open https://ID:password@domain.mdsol.com:443 -passive -explicitssl -explicittls
get "\RaveWebServices/Studies/study/datasets/regular/icf.csv" "D:\test.csv"


Please refer to the below log:

------------------------------------------------------------------------------------------
. 2019-10-21 17:28:26.745 --------------------------------------------------------------------------
. 2019-10-21 17:28:26.748 WinSCP 버전 5.15.4 (빌드 9849) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2019-10-21 17:28:26.757 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-10-21 17:28:26.759 Log level: Normal
. 2019-10-21 17:28:26.760 Local account: domain\ID
. 2019-10-21 17:28:26.762 Working directory: C:\Users\ID
. 2019-10-21 17:28:26.763 Process ID: 19948
. 2019-10-21 17:28:26.765 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="\SAS Data\Domain\temp.log" /console /script="\SAS Data\domain\script_xml.txt"
. 2019-10-21 17:28:26.768 Time zone: Current: GMT+9 (대한민국 표준시), No DST
. 2019-10-21 17:28:26.770 Login time: 2019년 10월 21일 월요일 오후 5:28:26
. 2019-10-21 17:28:26.773 --------------------------------------------------------------------------
. 2019-10-21 17:28:26.775 Script: Retrospectively logging previous script records:
> 2019-10-21 17:28:26.777 Script: option echo on
< 2019-10-21 17:28:26.779 Script: echo on
> 2019-10-21 17:28:26.780 Script: option batch abort
< 2019-10-21 17:28:26.782 Script: option batch abort
< 2019-10-21 17:28:26.783 Script: batch abort
> 2019-10-21 17:28:26.786 Script: option confirm off
< 2019-10-21 17:28:26.788 Script: option confirm off
< 2019-10-21 17:28:26.790 Script: confirm off
> 2019-10-21 17:28:26.792 Script: open https://ID:***@domain.mdsol.com:443 -passive -explicitssl -explicittls
< 2019-10-21 17:28:26.793 Script: open https://ID:***@domain.mdsol.com:443 -passive -explicitssl -explicittls
. 2019-10-21 17:28:26.795 --------------------------------------------------------------------------
. 2019-10-21 17:28:26.797 Session name: ID@domain.mdsol.com (Ad-Hoc site)
. 2019-10-21 17:28:26.798 Host name: domainmdsol.com (Port: 443)
. 2019-10-21 17:28:26.800 User name: ID (Password: Yes, Key file: No, Passphrase: No)
. 2019-10-21 17:28:26.802 Transfer Protocol: WebDAV
. 2019-10-21 17:28:26.804 Proxy: None
. 2019-10-21 17:28:26.806 HTTPS: Yes [Client certificate: No]
. 2019-10-21 17:28:26.807 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2019-10-21 17:28:26.808 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-10-21 17:28:26.810 Cache directory changes: Yes, Permanent: Yes
. 2019-10-21 17:28:26.811 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-10-21 17:28:26.812 DST mode: Unix
. 2019-10-21 17:28:26.813 Compression: No
. 2019-10-21 17:28:26.816 --------------------------------------------------------------------------
. 2019-10-21 17:28:26.828 HTTP session to https://domain.mdsol.com:443 begins.
. 2019-10-21 17:28:27.140 ssl: SNI enabled by default.
. 2019-10-21 17:28:27.145 ah_create, for WWW-Authenticate
. 2019-10-21 17:28:27.147 Sending request headers:
. 2019-10-21 17:28:27.148 OPTIONS / HTTP/1.1
. 2019-10-21 17:28:27.149 User-Agent: WinSCP/5.15.4 neon/0.30.2
. 2019-10-21 17:28:27.151 Keep-Alive:
. 2019-10-21 17:28:27.152 Connection: TE, Keep-Alive
. 2019-10-21 17:28:27.153 TE: trailers
. 2019-10-21 17:28:27.155 Host: domain.mdsol.com
. 2019-10-21 17:28:27.157 Sending request-line and headers:
. 2019-10-21 17:28:27.159 Doing DNS lookup on domain.mdsol.com...
. 2019-10-21 17:28:27.690 req: Connecting to 142.4.69.27:443
. 2019-10-21 17:28:28.007 Doing SSL negotiation.
. 2019-10-21 17:28:28.561 Identity match for 'domain.mdsol.com': good
. 2019-10-21 17:28:28.564 Verifying certificate for "Service Delivery, Medidata Solutions, Inc, New York, New York, US" with fingerprint 18:31:94:70:fe: 73:1b:f5 and 08 failures
. 2019-10-21 17:28:28.798 Certificate verified against Windows certificate store
. 2019-10-21 17:28:28.800 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
. 2019-10-21 17:28:28.802 Request sent; retry is 0.
. 2019-10-21 17:28:28.979 [status-line] < HTTP/1.1 200 OK
. 2019-10-21 17:28:28.980 Header Name: [allow], Value: [OPTIONS, TRACE, GET, HEAD, POST]
. 2019-10-21 17:28:28.983 Header Name: [server], Value: [Microsoft-IIS/10.0]
. 2019-10-21 17:28:28.985 Header Name: [public], Value: [OPTIONS, TRACE, GET, HEAD, POST]
. 2019-10-21 17:28:28.987 Header Name: [x-powered-by], Value: [ASP.NET]
. 2019-10-21 17:28:28.989 Header Name: [date], Value: [Mon, 21 Oct 2019 08:28:29 GMT]
. 2019-10-21 17:28:28.990 Header Name: [content-length], Value: [0]
. 2019-10-21 17:28:28.992 Header Name: [set-cookie], Value: [MedidataRave=!65OS6bVPD3D75W1ZPK4Sc85XtfOQzYtMjqB1fRrqRnMUYNmw0YoLgGjG5hCiiOYpFh4bdqcJ8BJD0o8=; path=/; Httponly; Secure]
. 2019-10-21 17:28:29.002 End of headers.
. 2019-10-21 17:28:29.004 ah_post_send (#0), code is 200 (want 401), WWW-Authenticate is (none)
. 2019-10-21 17:28:29.006 Request ends, status 200 class 2xx, error line:
. 2019-10-21 17:28:29.008 200 OK
. 2019-10-21 17:28:29.010 Request ends.
. 2019-10-21 17:28:29.013 --------------------------------------------------------------------------
. 2019-10-21 17:28:29.014 Using WebDAV protocol.
. 2019-10-21 17:28:29.016 Doing startup conversation with host.
. 2019-10-21 17:28:29.018 Getting current directory name.
. 2019-10-21 17:28:29.019 Startup conversation with host finished.
< 2019-10-21 17:28:29.021 Script: 활성화된 세션: [1] ID@domain.mdsol.com
> 2019-10-21 17:28:29.023 Script: get "\RaveWebServices/Studies/study/datasets/regular/icf.csv" "D:\test.csv"
< 2019-10-21 17:28:29.024 Script: get “\RaveWebServices/Studies/study/datasets/regular/icf.csv" "D:\test.csv"
. 2019-10-21 17:28:29.027 Listing file “\RaveWebServices/Studies/study/datasets/regular/icf.csv".
. 2019-10-21 17:28:29.029 ah_create, for WWW-Authenticate
> 2019-10-21 17:28:29.031 <?xml version="1.0" encoding="utf-8"?>
> 2019-10-21 17:28:29.032 <propfind xmlns="DAV:"><allprop/></propfind>
. 2019-10-21 17:28:29.034 Sending request headers:
. 2019-10-21 17:28:29.035 PROPFIND /%5c\RaveWebServices/Studies/study/datasets/regular/icf.csv HTTP/1.1
. 2019-10-21 17:28:29.037 User-Agent: WinSCP/5.15.4 neon/0.30.2
. 2019-10-21 17:28:29.039 Connection: TE
. 2019-10-21 17:28:29.040 TE: trailers
. 2019-10-21 17:28:29.041 Host: domain.mdsol.com
. 2019-10-21 17:28:29.043 Depth: 0
. 2019-10-21 17:28:29.044 Content-Length: 84
. 2019-10-21 17:28:29.045 Content-Type: application/xml
. 2019-10-21 17:28:29.047 Sending request-line and headers:
. 2019-10-21 17:28:29.048 Sending request body:
. 2019-10-21 17:28:29.049 Request sent; retry is 1.
. 2019-10-21 17:28:29.231 [status-line] < HTTP/1.1 404 Not Found
. 2019-10-21 17:28:29.233 Header Name: [cache-control], Value: [private]
. 2019-10-21 17:28:29.234 Header Name: [content-type], Value: [text/html; charset=utf-8]
. 2019-10-21 17:28:29.236 Header Name: [server], Value: [Microsoft-IIS/10.0]
. 2019-10-21 17:28:29.238 Header Name: [x-powered-by], Value: [ASP.NET]
. 2019-10-21 17:28:29.239 Header Name: [content-security-policy], Value: [frame-ancestors 'self']
. 2019-10-21 17:28:29.242 Header Name: [x-frame-options], Value: [SAMEORIGIN]
. 2019-10-21 17:28:29.243 Header Name: [date], Value: [Mon, 21 Oct 2019 08:28:30 GMT]
. 2019-10-21 17:28:29.245 Header Name: [connection], Value: [close]
. 2019-10-21 17:28:29.246 Header Name: [content-length], Value: [5124]
. 2019-10-21 17:28:29.247 End of headers.
. 2019-10-21 17:28:29.249 ah_post_send (#0), code is 404 (want 401), WWW-Authenticate is (none)
. 2019-10-21 17:28:29.250 sess: Closing connection.
. 2019-10-21 17:28:29.251 sess: Connection closed.
. 2019-10-21 17:28:29.253 Request ends, status 404 class 4xx, error line:
. 2019-10-21 17:28:29.254 404 Not Found
. 2019-10-21 17:28:29.255 Request ends.
< 2019-10-21 17:28:29.257 Script: 파일 '\RaveWebServices/Studies/study/datasets/regular/icf.csv'의 속성을 얻을 수 없습니다.
< 2019-10-21 17:28:29.258 404 Not Found
. 2019-10-21 17:28:29.261 Script: Failed
. 2019-10-21 17:28:29.262 Script: Exit code: 1
. 2019-10-21 17:28:29.264 sess: Destroying session.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

Re: How to get .csv file from the Https url?

I assume the culprit is the leading backslash. It should be a forward slash:
get "/RaveWebServices/Studies/study/datasets/regular/icf.csv" "D:\test.csv"

Reply with quote

MZL
Guest

Thanks a lot.
However, below error still occurred. Could you please confirm below log?:

019-10-22 17:26:39.497 [status-line] < HTTP/1.1 404 Not Found
. 2019-10-22 17:26:39.498 Header Name: [cache-control], Value: [private]
. 2019-10-22 17:26:39.500 Header Name: [content-type], Value: [text/html; charset=utf-8]
. 2019-10-22 17:26:39.501 Header Name: [server], Value: [Microsoft-IIS/10.0]
. 2019-10-22 17:26:39.502 Header Name: [x-powered-by], Value: [ASP.NET]
. 2019-10-22 17:26:39.504 Header Name: [content-security-policy], Value: [frame-ancestors 'self']
. 2019-10-22 17:26:39.505 Header Name: [x-frame-options], Value: [SAMEORIGIN]
. 2019-10-22 17:26:39.506 Header Name: [date], Value: [Tue, 22 Oct 2019 08:26:39 GMT]
. 2019-10-22 17:26:39.507 Header Name: [connection], Value: [close]
. 2019-10-22 17:26:39.509 Header Name: [content-length], Value: [5124]
. 2019-10-22 17:26:39.510 End of headers.
. 2019-10-22 17:26:39.512 ah_post_send (#0), code is 404 (want 401), WWW-Authenticate is (none)
. 2019-10-22 17:26:39.513 sess: Closing connection.
. 2019-10-22 17:26:39.514 sess: Connection closed.
. 2019-10-22 17:26:39.516 Request ends, status 404 class 4xx, error line:

Reply with quote

Advertisement

You can post new topics in this forum