Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

njlg

Re: WinSCP zeros files before uploading

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.
martin

Re: WinSCP zeros files before uploading

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.



> 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
njlg

Pastebin

Alright, I put the log up on pastebin (I wasn't sure if I could upload files if I created an account or not): https://pastebin.com/BvN018cD
martin

Re: WinSCP zeros files before uploading

Yes please, post a full log file showing the problem.
njlg

WinSCP zeros files before uploading

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)