Secure FTP plugin vs lost connection during editing the file

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: petermad, Stefan2, Hacker

Post Reply
Bitman_
Junior Member
Junior Member
Posts: 3
Joined: 2023-05-04, 10:22 UTC

Secure FTP plugin vs lost connection during editing the file

Post by *Bitman_ »

Hi,

I think I have found a bug, which not necessarily connected to Secure FTP plugin, but probably TC's remote file handling mechanism. (I have experienced the same with its 3rd party ancient predecessor "Secure FTP Connections" plugin).

So when I connect to SFTP with Christian Ghisler's Secure FTP plugin (btw many thanks for its implementation!) and open a remote file for edit (with F4, I'm using Notepad++ configured as editor) then TC downloads the file to a directory like this: c:\Users\<user>\AppData\Local\Temp\_tcx\0\Secure FTP\<SFTP_session_name>\<remote_path_on_server>\<filename>.<ext> and it opens the external editor to edit the given file. After this, TC watches the file for changes and reuploads the file if any changes made.

When I make some changes, and save in Notepad++, the file is saved (to c:\Users\<user>\AppData\Local\Temp\_tcx\0\Secure FTP\<SFTP_session_name>\<remote_path_on_server>\<filename>.<ext>), and TC detects the change, and tries to upload it to the remote server, but sometimes the connection might be broken (due to timeout usually, etc).
In these cases, TC provides an error message that it couldn't upload the file and asks if I want to keep it locally anyway. I don't know the exact message in English, but in Hungarian the WCMD_HUN.LNG contains the exact phrase in this line:
1230="Nem lehet újra feltölteni a fájlt - maradjon a megváltozott fájl '%s'?"

If I answer with Yes, then TC keeps the file at c:\Users\<user>\AppData\Local\Temp\_tcx\0\Secure FTP\<SFTP_session_name>\<remote_path_on_server>\<filename>.<ext>
This is good practise to not lose my changes. However, when I reestablish my broken SFTP connection and download the same file from the same remote server's same path, then TC overwrites the locally kept file under the same path, but when I do any changes to it, it just doesn't uploads the file. For me it seems like it cannot watch the file for some reason.
In the SFTP command window (wcftplog.000) I see no upload attempt, only the fact that the file downloaded, for example:
Download file: /<remote_path>/<remotefile>

When the connection identified as broken during the first and only upload attempt, I see nothing extraordinary in the sftp commands:

Code: Select all

Upload file: /<remote_path>/mydir/<remote_file>
Get directory: \<remote_path>
Connection lost, trying to reconnect!
========================
Connecting to: <ip>
<it successfully reconnects>
The only WA when this happens is to restart TC. Other files can be edited and TC still manages to upload their changes, except for the 1 problematic file where the connection failed.

Can you please take a look into this? When working with multiple remote files its painful to close each in the editor, and restart TC and reopen all the remote files for editing.

Edit: I'm using version 11.56, but it was the same in many older versions since years (I think), I have just never opened a bug report. Plugin version is the latest: 3.05 final
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Secure FTP plugin vs lost connection during editing the file

Post by *ghisler(Author) »

So far I couldn't reproduce the error. Here is what I tried:
1. Connect to a server via SFTP plugin
2. Open a file with F4
3. Unplug the LAN cable
4. Modify and save the file
-> After a while I get a connection error, and then I'm asked whether I want to keep the file. Click Yes.
5. Plug the LAN cable back in
6. Close the editor
7. Press Ctrl+R to refresh -> The plugin reconnects automatically
8. Open the file again with F4
9. Modify and save the file
-> The file is uploaded automatically.
Author of Total Commander
https://www.ghisler.com
JOUBE
Power Member
Power Member
Posts: 1929
Joined: 2004-07-08, 08:58 UTC

Re: Secure FTP plugin vs lost connection during editing the file

Post by *JOUBE »

In my experience, problems do occur when the connection is interrupted, especially if you then - after reconnection - (mistakenly) restart download and editing with F4. (if I answered "Yes, keep", then after F4 I got the question: Overwrite...? )

Here, however, such connection interruptions are quite rare. Therefore, in such a case, I can afford to take the time to save the file under a different name in a directory of my choice. This way, I can avoid potentially losing the newly edited text: So I choice [Cancel], save the file under other path and name, then answer "No, do not keep". And additional, because it is uploaded automaticily after changes in the background *), I save files often while editing.

Joube

*) I advocated for the implementation of this automation as a very useful feature many, many many years ago.Readable here in the forum.
JOUBE
Power Member
Power Member
Posts: 1929
Joined: 2004-07-08, 08:58 UTC

Re: Secure FTP plugin vs lost connection during editing the file

Post by *JOUBE »

Bitman_ wrote: 2025-12-31, 10:59 UTC sometimes the connection might be broken (due to timeout usually, etc).
Is the scenario you described still an active problem for you?

Have you enabled option "Send command to keep alive connection (seconds):" in the connection properties to prevent timeouts?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Secure FTP plugin vs lost connection during editing the file

Post by *ghisler(Author) »

Unfortunately I could not reproduce this problem (see above), so I'm moving this thread to will not be changed. If anyone finds a way to reproduce it, please post step by step instructions like I did above.

Moderator message from: ghisler(Author) » 2026-04-27, 09:00 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply