Scripting SFTP mput shows the files transferred in rounded KB and need it in bytes.

Advertisement

fxdwg99
Joined:
Posts:
3

Scripting SFTP mput shows the files transferred in rounded KB and need it in bytes.

I’m doing a WinSCP SFTP connection on a Windows 2019 server from a batch file. (scripting/automation)

WinSCP 5.17.10 (Build 11087) This is my first time using WinSCP.

I need to see the file sizes transferred in bytes. I found a way to change the GUI to display in bytes, but I don’t see an option for command line.

Below are examples of Windows native FTP and WinSCP SFTP. Windows FTP shows the exact file size in bytes where WinSCP looks like it rounds the values.

For example the first file in each example is 1212 bytes but WinSCP shows it as 1 KB.

==> Windows native FTP from a batch file:
ftp> mput f:\edi\ediprd\appi\g53\nps867\prd\GOOD867*.txt

150 Opening ASCII mode data connection for GOOD867-CNT20210421141136.txt
ftp: 1212 bytes sent in 0.33Seconds 3.70Kbytes/sec.

150 Opening ASCII mode data connection for GOOD867-Partners20210421141137.txt
ftp: 710 bytes sent in 0.30Seconds 2.40Kbytes/sec.

150 Opening ASCII mode data connection for GOOD86720210421141136.txt
ftp: 643153 bytes sent in 1.09Seconds 587.89Kbytes/sec.

150 Opening ASCII mode data connection for GOOD867SAP-CNT20210421141146.txt
ftp: 808 bytes sent in 0.30Seconds 2.72Kbytes/sec.

150 Opening ASCII mode data connection for GOOD867SAP-Partners20210421141146.txt
ftp: 426 bytes sent in 0.31Seconds 1.36Kbytes/sec.

150 Opening ASCII mode data connection for GOOD867SAP20210421141145.txt
ftp: 40982 bytes sent in 0.41Seconds 100.94Kbytes/sec.
==> WinSCP SFTP from a batch file:
mput f:\edi\ediprd\appi\g53\nps867\prd\GOOD867*.txt
f:\edi\ediprd\appi\g53\nps867\prd\GOOD867-CNT20210424192225.txt |           1 KB |    0.0 KB/s | binary | 100%
f:\edi\ediprd\appi\g53\nps867\prd\GOOD867-Partners20210424192225.txt |          710 B |    1.3 KB/s | binary | 100%
f:\edi\ediprd\appi\g53\nps867\prd\GOOD86720210424192225.txt |         628 KB |  338.0 KB/s | binary | 100%
f:\edi\ediprd\appi\g53\nps867\prd\GOOD867SAP-CNT20210424192228.txt |          808 B |  287.7 KB/s | binary | 100%
f:\edi\ediprd\appi\g53\nps867\prd\GOOD867SAP-Partners20210424192228.txt |          426 B |  250.4 KB/s | binary | 100%
f:\edi\ediprd\appi\g53\nps867\prd\GOOD867SAP20210424192227.txt |          40 KB |  236.8 KB/s | binary | 100%

Reply with quote

Advertisement

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

Re: Scripting SFTP mput shows the files transferred in rounded KB and need it in bytes.

Sorry, WinSCP scripting cannot display the transfer progress in bytes.

Reply with quote

Guest

Re: Scripting SFTP mput shows the files transferred in rounded KB and need it in bytes.

Sorry I'm new to WinSCP forum. Is this the correct place to request a enhancement?

It sounds like there was a need for it because the GUI has an option to display in bytes.

It would be very helpful for scripting to do the same. We use bytes in trouble shooting to verify exactly file was sent.

Reply with quote

Advertisement

You can post new topics in this forum