curl / Mailing Lists / curl-library / Single Mail


Re: Upload a file with preserving Modified File Time

From: Daniel Stenberg <>
Date: Thu, 10 Aug 2017 23:20:50 +0200 (CEST)

On Thu, 3 Aug 2017, Keith Patella wrote:

> I'm using a sftp server WingFTP and am uploading files but have been unable
> to figure out how to preserve the Modified file time on Windows. I've been
> using libcurl latest version but am now trying to do it through the command
> line. I'm using the following:

> No matter what I try my file is always set to the time it was uploaded.

Sorry, libcurl doesn't have any support for sending/setting the time of the
remote file over SFTP! The underlying libssh2 library has an API for doing it
(libssh2_sftp_fstat_ex), but libcurl has no mechnism for using that.

In fact, libcurl doesn't offer it for any protocol for uploads.

Received on 2017-08-10