FTP reuploading files to wrong path when using tabs

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
kuba2k2
Junior Member
Junior Member
Posts: 5
Joined: 2021-08-13, 10:58 UTC
Location: Poland

FTP reuploading files to wrong path when using tabs

Post by *kuba2k2 »

Hi,
I found this bug several versions ago, and it's still present in 10.00 final.

Steps to reproduce:
- connect to FTP, navigate to /home/user/Documents/
- edit (F4) file.txt
- go to /home/user/
- switch to another tab (i.e. your C drive)
- save the file.txt in the text editor

Actual behavior:
- the file.txt gets uploaded as /home/user/file.txt

Expected behavior:
- the file.txt gets uploaded as /home/user/Documents/file.txt, from where it was opened.
- the behavior is correct when the current tab is still the FTP one, no matter the navigated path.

This produces visible problems when working with some kind of source code, when you see the file uploaded (somewhere), but the code you're working on doesn't get updated.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: FTP reuploading files to wrong path when using tabs

Post by *ghisler(Author) »

Thanks for the report. Please stay on the ftp server while editing files - TC cannot change directory while not on the server. Maybe I should try to change tabs in this situation?
Author of Total Commander
https://www.ghisler.com
kuba2k2
Junior Member
Junior Member
Posts: 5
Joined: 2021-08-13, 10:58 UTC
Location: Poland

Re: FTP reuploading files to wrong path when using tabs

Post by *kuba2k2 »

Hi, I'm not sure what do you mean by "change tabs in this situation". From my perspective, this is clearly a bug or anyway an issue that creates problems, when for example working on something spanned over multiple dirs and using the local PC at the same time.

TC knows the original file path when saving, it also can CWD to that path when the FTP is the current tab/drive, so why cannot it CWD when being on another drive? It's still connected, right?

The CWD command works upon saving when I'm still on the same server - even when I'm on a different FTP tab (i.e. 1:/ with the file opened from 0:/) but when being on another FTP server it's uploading to the wrong path.

I'm attaching some logs too, maybe they'll help.

Uploading with the FTP tab active:

Code: Select all

CWD /home/android/
250 OK. Current directory is /home/android
PWD
257 "/home/android" is your current location
TYPE I
200 TYPE is now 8-bit binary

PASV
227 Entering Passive Mode (x,x,x,x,255,41)
Connected to PASV port
STOR .wget-hsts
150 Accepted data connection
Upload: 215 bytes
226-File successfully transferred
226 0.016 seconds (measured here), 13.47 Kbytes per second
SIZE .wget-hsts
213 215
Copied (2021-08-18 13:55:55): C:\Users\user\AppData\Local\Temp\_tcx\4\0\home\android\.wget-hsts -> ftps://example.com/home/android/.wget-hsts 215 bytes, 1 kbytes/s

PWD
257 "/home/android" is your current location
CWD /home/android/Templates/
250 OK. Current directory is /home/android/Templates
PWD
257 "/home/android/Templates" is your current location
Uploading with the FTP tab backgrounded/another drive active - incorrect path:

Code: Select all

PASV
227 Entering Passive Mode (x,x,x,x,82,212)
Connected to PASV port
STOR .wget-hsts
150 Accepted data connection
Upload: 215 bytes
226-File successfully transferred
226 0.017 seconds (measured here), 12.26 Kbytes per second
SIZE .wget-hsts
213 215
Copied (2021-08-18 13:56:34): C:\Users\user\AppData\Local\Temp\_tcx\4\0\home\android\.wget-hsts -> ftps://example.com/home/android/Templates/.wget-hsts 215 bytes, 1 kbytes/s
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: FTP reuploading files to wrong path when using tabs

Post by *Usher »

2kuba2k2
TC has an option "All uploads/downloads in background" for FTP transfer. Have you tested file editing with this option turned on?
Andrzej P. Wozniak
Polish subforum moderator
kuba2k2
Junior Member
Junior Member
Posts: 5
Joined: 2021-08-13, 10:58 UTC
Location: Poland

Re: FTP reuploading files to wrong path when using tabs

Post by *kuba2k2 »

Apparently I have it turned on the whole time, but changing it does not make any difference. It's like TC was uploading to the currently selected directory on purpose...
I also tried disabling passive mode, but it does not seem to work on my server - files are transferred after PASV anyway.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: FTP reuploading files to wrong path when using tabs

Post by *ghisler(Author) »

I think I found a solution now, I will put it in the next beta this fall. For now, either don't switch tabs or stay in the directory where the file is located, or both.
Author of Total Commander
https://www.ghisler.com
kuba2k2
Junior Member
Junior Member
Posts: 5
Joined: 2021-08-13, 10:58 UTC
Location: Poland

Re: FTP reuploading files to wrong path when using tabs

Post by *kuba2k2 »

Cool, thanks!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: FTP reuploading files to wrong path when using tabs

Post by *ghisler(Author) »

This should be fixed in Total Commander 10.50 beta, please try it.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: FTP reuploading files to wrong path when using tabs

Post by *ghisler(Author) »

This should be fixed in TC 11 beta (actually already in 10.50), please test it.
Author of Total Commander
https://www.ghisler.com
kuba2k2
Junior Member
Junior Member
Posts: 5
Joined: 2021-08-13, 10:58 UTC
Location: Poland

Re: FTP reuploading files to wrong path when using tabs

Post by *kuba2k2 »

Hi, sorry for the late answer. Tested right now on 11 beta, and works perfectly fine, thanks for the fix!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: FTP reuploading files to wrong path when using tabs

Post by *ghisler(Author) »

Great, thanks a lot for your feedback!
Author of Total Commander
https://www.ghisler.com
Post Reply