Using SFTP, timestamps not honored

When connecting using SFTP, the timestamps are not being set properly when uploading. I am connecting with SFTP (Server is running OpenSSH on Windows) and I have the favorite properties set thusly:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads appear to work fine. Uploads always get stamped with the current time, not the timestamp of the uploaded file. Both machines are in the same timezone and the favorite's timezone is set in the favorite properties as well.

Here is a log of a transfer ...

[16:40:07] SmartFTP v3.0.1026.8
[16:40:07] Resolving host name "..."
[16:40:07] Connecting to .... Port: 22
[16:40:07] SSH-2.0-OpenSSH_5.2
[16:40:07] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.2"
[16:40:07] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[16:40:09] Computing session key.
[16:40:09] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[16:40:10] Key exchange completed.
[16:40:10] Host Key Algorithm: ssh-rsa
[16:40:10] Client to Server Encryption: aes256-ctr
[16:40:10] Server to Client Encryption: aes256-ctr
[16:40:10] Session MAC: hmac-sha1
[16:40:10] Client to Server Compression: none
[16:40:10] Server to Client Compression: none
[16:40:10] Authentication request. Method: "none"
[16:40:10] Server supported authentications: publickey,password,keyboard-interactive
[16:40:10] Authentication request. Method: "password"
[16:40:10] User authentication successful.
[16:40:11] SSH session established.
[16:40:11] Connected to ...
[16:40:11] RTT: 273.003 ms
[16:40:11] SFTP protocol version 3
[16:40:11] Detected Server Software: OpenSSH
[16:40:27] Resolving path "XXXXXXXXX".
[16:40:27] Path successfully resolved.
[16:40:27] Reading directory "XXXXXXXXX".
[16:40:28] 6797 bytes transferred. (10.8 KB/s) (609 ms)
[16:40:28] Directory listing complete.
[16:40:51] Getting attributes of "XXXXXXXX/testfile.txt".
[16:40:51] Attributes successfully obtained.
[16:40:58] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[16:41:02] Getting attributes of "XXXXXXXXX/testfile.txt".
[16:41:02] Attributes successfully obtained.

The problem is the localfile testfile.txt has one timestamp, the server file is stamped with the time it was uploaded.

Please install the latest version:
https://www.smartftp.com/download

And if the problem persists please post the transfer log from the transfer queue. To get it double click the file in the transfer queue before it's processed.

Regards,
Mat

Bug confirmed. Thank you for reporting. A newer version of SmartFTP will include the bug fix.

I'm having the same problem with SmartFTP 4.0.1215.0 when using SFTP (I just upgraded to be able to use SFTP, so there may be something that I missed but when I read this entry I found that my trouble is exactly the same, although my version is newer).

Settings:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads keep their modify dates, uploads are forced to the current date.

Also, when I want to overwrite files on the server, but my local copy has an earlier date, nothing is transferred at all. No warning window, no error message or anything. Is this part of the problem, or just a setting that I forgot?

The log:

[00:14:07] Resolving host name "XXXX"
[00:14:07] Connecting to XXX.XXX.XXX.XXX Port: 22
[00:14:08] SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
[00:14:08] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3"
[00:14:08] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[00:14:08] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[00:14:08] Server "ssh-rsa" host key fingerprint: XXXXXXXXXX
[00:14:08] Key exchange completed.
[00:14:08] Host Key Algorithm: ssh-rsa
[00:14:08] Client to Server Encryption: aes256-ctr
[00:14:08] Server to Client Encryption: aes256-ctr
[00:14:08] Session MAC: hmac-sha1
[00:14:08] Client to Server Compression: zlib@openssh.com
[00:14:08] Server to Client Compression: zlib@openssh.com
[00:14:08] Requesting service "ssh-userauth".
[00:14:09] RTT: 240.598 ms
[00:14:09] Authentication request. Method: none
[00:14:09] Server supported authentications: publickey,password
[00:14:09] Authentication request. Method: password
[00:14:09] User authentication successful.
[00:14:09] SSH session established.
[00:14:09] Connected to XXXX.
[00:14:09] Detected Server Software: OpenSSH
[00:14:09] Opening channel 0.
[00:14:09] Channel successfully opened (Local=0, Remote=0).
[00:14:09] Requesting subystem "sftp" (Local=0, Remote=0).
[00:14:09] Sending FXP initialization. Protocol version=6.
[00:14:09] SFTP protocol version 3

Now I try to overwrite a file on the server with a local one, but with an older date --> nothing happens
[00:14:55] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.

So in order to be able to transfer it I delete the remote file and upload my local version --> remote version gets its timestamp modified to the current time
[00:15:06] Deleting file "/XXXX/public_html/index.htm".
[00:15:07] File successfully deleted.
[00:15:10] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[00:15:11] Getting attributes of "/XXXX/public_html/index.htm".
[00:15:11] Attributes successfully obtained.

>Upload keep date
Take a look at the transfer log and post it here. You can get the transfer log by double clicking the file in the transfer queue before the transfer has completed.

>overwrite
When you drag&drop a file to the server and there is already file with the same name, you will see a "file exist/conflict" dialog where you are prompted for the action. Select overwrite and the file will be overwritten.

Transfer log single (new) file:

[01:00:51] Operation Begin
[01:00:51] Resolving path "/srv/www/XXXX/public_html".
[01:00:51] Path successfully resolved to "/srv/www/XXXX/public_html".
[01:00:51] Remote file exist check: "news-05.htm".
[01:00:51] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] 2 No such file
[01:00:51] Uploading file to "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] StartPosition=0, EndPosition=0.
[01:00:51] 35130 bytes transferred. (Unknown/s) (0 ms)
[01:00:51] Closing file handle.
[01:00:52] File successfully transferred.
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully set.
[01:00:52] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully obtained.
[01:00:52] Source File Size=35130, Destination File Size=35130
[01:00:52] Operation End

Overwrite:

I checked my settings for "File Exists". It is "Remote Browser --> Use Default Settings". With this setting I won't have to confirm. But as I said, a newer file on the server is never overwritten, and nothing at all happens.

When I switch to "Ask" I can overwrite the file and (WOW!) it even keeps the date on the server. But confirming everything is not what I want. I always want to overwrite any file on the remote server, without the need to confirm. I could put up with a prompt window in case I try to overwrite a newer file but most definitely not for every file.

And now something very odd:

Actually, after switching "Remote Browser --> Use Default Settings" to "Ask" and even back, I tried again to upload a new file, and it kept the file date.

I then closed SmartFTP, I launched it and logged on again, and the problem was there again. Keep modify date doesn't work.

This problem is anything but reproducible for me.

>overwrite
What you are seeing is the expected behavior.

>date
From the log I can see that SmartFTP sets the file time:
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
So I believe the problem must be somewhere else.

Ok. Thanks for checking. I will check back with the server admin if there's anything we haven't taken into account yet.

However, I tried to transfer files with Firefox FireFTP plug-in, setting "keep timestamps in sync", and it worked just fine.

And one basic question about "File Exists" setting: So far (with conventional FTP) I always had it set to overwrite existing files, without asking. Provided that the server works correctly and is configured accordingly, what would be the setting in SmartFTP? What I need is a setting that always overwrites any file on the server with my local master record, irrespective of the date (and that keeps the date of the local file). The way it works now (either with manual confirmation or with the possibility that files are not transferred) is not an option by any means.

Is there a difference in the protocol or the configuration between FTP and SFTP that I'm not aware of?

>keep filetime
As far as I know FireFTP only supports the FTP protocol but in SmartFTP you are using SFTP. Try to switch to FTP/FTPS.

>file exist behavior
It's protocol independent. The file exist rules are configurable. You can setup SmartFTP to always overwrite the file (not recommended).

>sftp
Send a test user/password to our support email address and we will try to reproduce the problem.


>sftp
Send a test user/password to our support email address and we will try to reproduce the problem.

I'll forward that to the server admin. Thanks.