Topic "WinSCP zeros files before uploading"

Author Message
njlg

Guest


When I drag-n-drop a file from the my local workstation to the server view, to upload a file to the server, and a file by that name already exists on the server, WinSCP zeros the file on the server before presenting the confirmation dialog. The dialog actually says something like this:

. 2011-05-31 09:14:58.955 Asking user:
. 2011-05-31 09:14:58.955 Remote file 'test.txt' already exists. Overwrite?
. 2011-05-31 09:14:58.955
. 2011-05-31 09:14:58.955 New: 76 bytes, 5/31/2011 9:10:13 AM
. 2011-05-31 09:14:58.955 Existing: 0 bytes, 5/31/2011 10:15:01 AM ()

My question is, how do I prevent this behaviour? If I accidentally try to upload the wrong file, by the time I realize and get to cancel the upload, the file has already been cleared.

(I will try to upload a log after I submit this)
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
Yes please, post a full log file showing the problem.
_________________
Martin Prikryl
njlg

Guest


Alright, I put the log up on pastebin (I wasn't sure if I could upload files if I created an account or not): http://pastebin.com/BvN018cD
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
WinSCP indeed sends a bit contradictive request to "truncate file if it does not exist" (SSH_FXF_TRUNC + SSH_FXF_EXCL). But anyway, it is valid according to the SFTP spec and the server should fail the request if the file does exist. It indeed failes the request, but maybe it (incorrectly) truncates the file before failing.

You should seek a support on Tectia side.

Anyway, can you send me an email, so I can send you back a debug version of WinSCP if I manage to implement workaround? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.


Quote:
> 2011-05-31 09:14:58.194 Type: SSH_FXP_OPEN, Size: 50, Number: 3843
> 2011-05-31 09:14:58.194 03,00,00,0F,03,00,00,00,19,2F,68,6F,6D,65,2F,70,63,33,34,31,33,33,2F,6E,6A,
> 2011-05-31 09:14:58.194 2F,74,65,73,74,2E,74,78,74,00,00,00,3A,00,00,00,01,00,00,00,00,00,00,00,4C,
...
< 2011-05-31 09:14:58.534 Type: SSH_FXP_STATUS, Size: 63, Number: 3843
< 2011-05-31 09:14:58.534 65,00,00,0F,03,00,00,00,04,00,00,00,2C,46,69,6C,65,20,65,78,69,73,74,73,2C,
< 2011-05-31 09:14:58.534 20,66,69,6C,65,3A,20,2F,68,6F,6D,65,2F,70,63,33,34,31,33,33,2F,6E,6A,2F,74,
< 2011-05-31 09:14:58.534 65,73,74,2E,74,78,74,00,00,00,02,65,6E,
< 2011-05-31 09:14:58.534 Status code: 4, Message: 3843, Server: File exists, file: /home/nathan/nj/test.txt, Language: en

_________________
Martin Prikryl
njlg
[View user's profile]

Joined: 2011-06-03
Posts: 1
Location: Portland, Oregon, USA
I sent you an email. Feel free to send me a debugged version of WinSPC if you find a work-around. In the mean time I'll what I can do about the ssh server.
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