cURL / Mailing Lists / curl-library / Single Mail


sftp file upload doesn't truncate file

From: Kristian Gunstone <>
Date: Wed, 9 May 2007 16:58:26 +0200

Hello again!

I just noticed another problem, now regarding sftp upload.

If I upload a file via sftp, but the file already exists on the remote
host, libcurl will not truncate it. It will just overwrite the number of
bytes specified with CURLOPT_INFILESIZE from the beginning of the file.

I solved this by changing lib/ssh.c:726 from

This will correctly truncate the file.

I also made a diff of it which can be located here:


Kristian Gunstone
Received on 2007-05-09