ashkulz / NppFTP

Plugin for Notepad++ allowing FTP, FTPS, FTPES and SFTP communications
https://ashkulz.github.io/NppFTP/
320 stars 93 forks source link

FTP connection disconnects when saving to an Azure Web App #306

Open KillerByteUK opened 3 years ago

KillerByteUK commented 3 years ago

Description of the Issue

When attempting to save using the FTP credentials for an Azure Web App, the session gets disconnected and no data is saved. The FTP credentials work successfully to retrieve the file listing and download files but upon saving the console shows that 'Quit' is sent which causes the connection to disconnect. One theory is that this may be because Azure Web App FTP credentials use a backslash in the username.

Steps to Reproduce the Issue

  1. Go to Profile Settings
  2. Create NppFTP profile for an Azure Web App
  3. Enter the hostname and choose a connection type (FTP/FTPS)
  4. Enter the username in the provided format (appname\username)
  5. Enter the password
  6. Enter the initial remote directory
  7. Toggle Show Messages Window On
  8. Connect to the new connection
  9. Browse to a file and double-click to download and edit
  10. Make a change to the file
  11. Save the file

Expected Behavior

File with amendments should be uploaded to the FTP site

Actual Behavior

Quit message is sent to the FTP site which then returns Disconnected

Debug Information

Notepad++ v7.9.1 (64-bit) Build time : Nov 2 2020 - 01:07:46 Path : C:\Program Files\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 2009 OS Build : 19042.804 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll NppFTP version: 0.29.6 Unicode Type of FTP connection: FTP, FTPS --> Type of authentication: password

chcg commented 3 years ago

There are already some issues open regarding "special" characters (https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3) not supported by the windows filesystem, but e.g. by Linux on the ftp server. This might be a similar issue that breaks the cache hit by a misinterpretation of the \ in the username as folder separator. Some escaping is missing for such input.

dlcrouch2 commented 2 years ago

I've run into this issue myself. I love Notepad++ and this plugin, but I can't use it for my work until this is fixed.

Is anyone still maintaining this plugin? I'd be willing to try fixing the issue myself, but all my relevant experience is in C and C#. I've never used C++ and have no idea where to look in the code.

Yngve0 commented 1 year ago

I have the same issue when trying to save files to Azure WebSite with NppFTP. Are there any workaround?

chcg commented 1 year ago

@Yngve0 Under NppFTP Toolbar->Settings->General Settings you could try to remove the username from the cache:

%CONFIGDIR%\Cache\%USERNAME%@%HOSTNAME% -> %CONFIGDIR%\Cache\%HOSTNAME%

if that is sufficient for your setup of ftp sites. Otherwise in the profile settings you could setup individual cache path, see docu https://ashkulz.github.io/NppFTP/ or https://github.com/ashkulz/NppFTP/blob/master/docs/index.md#cache-paths.