Topic "Error send files with sftp. After transfer 2 files .filepart & completed"

Author Message
dchristopoulos
[View user's profile]

Joined: 2016-03-31
Posts: 2
Location: Athens
Hello i need your help.

i use the following script with task scheduler:
-------------------------------------------------------------------------------
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server using a password
open sftp://demo-ftp:password@192.168.1.43:22 -hostkey="ssh-rsa 1024 xxxxxxxxxxxxx"
# Upload file After complete delete files from source
cd /inbox
Option exclude */
put -resumesupport=on -delete F:\Sync_Folder\outbox\*.*
# Disconnect
close
exit
----------------------------------------------------------------------------

The problem is the following:
Sometimes at the destination folder i have the .filepart
but when the transfer completed at the destination i have 2 files:
One with extention .filepart
and the file completed transfered (.xml) but if i open both of them none of them is the right one.
The .filepart file is not completed and the xml file has many empty characters at the start inside the xml so it is damaged.

Below are the logs data
------------------------------------------------------------------------------------------
. 2016-03-30 14:33:38.967 Copying "F:\Sync_Folder\outbox\Components.xml" to remote directory started.
. 2016-03-30 14:33:38.967 Binary transfer mode selected.
. 2016-03-30 14:33:38.967 Checking existence of file.
> 2016-03-30 14:33:38.967 Type: SSH_FXP_LSTAT, Size: 69, Number: 5127
< 2016-03-30 14:33:39.811 Type: SSH_FXP_STATUS, Size: 29, Number: 5127
< 2016-03-30 14:33:39.811 Status code: 2
. 2016-03-30 14:33:39.811 Checking existence of partially transfered file.
> 2016-03-30 14:33:39.811 Type: SSH_FXP_LSTAT, Size: 78, Number: 5383
< 2016-03-30 14:33:40.701 Type: SSH_FXP_ATTRS, Size: 37, Number: 5383
. 2016-03-30 14:33:40.701 Resuming file transfer.
. 2016-03-30 14:33:40.701 Opening remote file.
> 2016-03-30 14:33:40.701 Type: SSH_FXP_OPEN, Size: 86, Number: 5635
< 2016-03-30 14:33:41.545 Type: SSH_FXP_HANDLE, Size: 27, Number: 5635
> 2016-03-30 14:33:41.545 Type: SSH_FXP_WRITE, Size: 4135, Number: 6150
. 2016-03-30 14:34:02.217 90 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2016-03-30 14:34:02.217 Type: SSH_FXP_CLOSE, Size: 27, Number: 18948
< 2016-03-30 14:34:04.029 Type: SSH_FXP_STATUS, Size: 24, Number: 16646
< 2016-03-30 14:34:06.451 Type: SSH_FXP_STATUS, Size: 24, Number: 16902
< 2016-03-30 14:34:06.529 Type: SSH_FXP_STATUS, Size: 24, Number: 17158
< 2016-03-30 14:34:07.217 Type: SSH_FXP_STATUS, Size: 24, Number: 17414
< 2016-03-30 14:34:08.045 Type: SSH_FXP_STATUS, Size: 24, Number: 17670
< 2016-03-30 14:34:10.108 Type: SSH_FXP_STATUS, Size: 24, Number: 17926
< 2016-03-30 14:34:10.108 Type: SSH_FXP_STATUS, Size: 24, Number: 18182
< 2016-03-30 14:34:11.607 Type: SSH_FXP_STATUS, Size: 24, Number: 18438
< 2016-03-30 14:34:11.623 Type: SSH_FXP_STATUS, Size: 24, Number: 18694
< 2016-03-30 14:34:11.623 Type: SSH_FXP_STATUS, Size: 24, Number: 18948
< 2016-03-30 14:34:11.623 Status code: 0
> 2016-03-30 14:34:11.623 Type: SSH_FXP_RENAME, Size: 142, Number: 19218
< 2016-03-30 14:34:12.342 Type: SSH_FXP_STATUS, Size: 24, Number: 19218
< 2016-03-30 14:34:12.342 Status code: 0
. 2016-03-30 14:34:12.342 Preserving timestamp [2016-03-30T11:18:27.000Z]
> 2016-03-30 14:34:12.342 Type: SSH_FXP_SETSTAT, Size: 81, Number: 5897
< 2016-03-30 14:34:13.123 Type: SSH_FXP_STATUS, Size: 24, Number: 5897
< 2016-03-30 14:34:13.123 Status code: 0
. 2016-03-30 14:34:13.123 Transfer done: 'F:\Sync_Folder\outbox\Components.xml' [475898]
-------------------------------------------------------------------------------------------------------------
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25018
Location: Prague, Czechia
The log shows that file rename succeeded. If there was a .filepath file after the transfer nevertheless, it's server-side bug.
dchristopoulos
[View user's profile]

Joined: 2016-03-31
Posts: 2
Location: Athens
The problem is that the file rename succeeded but the content had problems.

It was a simple xml which had many empty spaces in the start of the body.
Do you want to upload an example?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25018
Location: Prague, Czechia
Well, those two issues have likely the same cause. I do not think seeing the content would help.

You can of course try to disable a transfer to a temporary file name in WinSCP preferences:
https://winscp.net/eng/docs/ui_pref_resume
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License