ashkulz / NppFTP

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

NppFTP transfer works but save doesn't #206

Open MrDiscret opened 6 years ago

MrDiscret commented 6 years ago

Description of the Issue

I am trying to use NppFTP with Notepad++ to save files in two different locations, namely to C:\xampp\htdocs directory as well as to an external HDD where the path is actually Z:\xampp\htdocs

I have FileZilla server installed on a Windows 10 machine.

Although I can upload the file by opening it in Notepad++ and lcicking the "up" arrow in the NppFTP window, whenever I save the file I am getting a failure.

NppFTP - Output when uploading file:

-> TYPE I
200 Type set to I -> PASV
227 Entering Passive Mode (127,0,0,1,236,35) -> STOR /htdocs/myproject/membership.php
150 Opening data channel for file upload to server of "/htdocs/myproject/membership.php" 226 Successfully transferred "/htdocs/myproject/membership.php" Upload of /htdocs/myproject/membership.php succeeded. -> CWD /htdocs/myproject/
250 CWD successful. "/htdocs/myproject" is current directory. -> PASV
227 Entering Passive Mode (127,0,0,1,195,146) -> LIST
150 Opening data channel for directory listing of "/htdocs/myproject" 226 Successfully transferred "/htdocs/myproject"

NppFTP - Output when saving file

-> TYPE I
200 Type set to I -> PASV
227 Entering Passive Mode (127,0,0,1,239,46) -> STOR /htdocs/ottomatic.info/membership.php
550 Filename invalid Upload of C:\xampp\htdocs\myproject\membership.php failed

Steps to Reproduce the Issue

Here is what I've tried...

Try nr. 1:

  1. Open C:\xampp\htdocs\myproject\membership.php
  2. Edit the file
  3. Save the file | action result: file has been saved but has not been uploaded/copied to the remote location (Z)

Try nr. 2:

  1. Open C:\xampp\htdocs\myproject\membership.php
  2. Click the "up" arrow in the NppFTP window | action result: file has been copied to the remote location (Z:\xampp\htdocs\myproject)
  3. Edit the file
  4. Save the file | action result: file has been saved locally but it wasn't uploaded/copied to the remote location (Z)
  5. Tried to upload the edited file ("up" arrow) | action result: the edited file has been, again, copied to the remote location (Z:\xampp\htdocs\myproject)

Expected Behavior

Expected behavior would've been to have the file automatically copied to the remote location whenever it's being saved.

Debug Information

Debug info:

Notepad++ v7.5.4 (64-bit) Build time : Jan 1 2018 - 01:50:29 Path : C:\Program Files\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS : Windows 10 (64-bit) Plugins : AnalysePlugin.dll ComparePlugin.dll CsvQuery.dll DSpellCheck.dll HTMLTag.dll JsMapParser.NppPlugin.dll mimeTools.dll NppConverter.dll NppExec.dll NppFTP.dll NPPJSONViewer-x64.dll NppXmlTreeviewPlugin.dll OpenSelection.dll PluginManager.dll

NppFTP version: 0.27.3 Unicode

Type of FTP connection: FTP

Authentication: root with no password

hostname: localhost (127.0.0.1)

Hope someone can help with this issue.

MrDiscret commented 6 years ago

I just read in another report (Issue #148 ) that someone only had this problem with certain files (at least to my understanding) but the .txt files do upload correctly upon saving.

I just tried this with a couple of .txt files (an existing one and a new one I created for this purpose only) bu the behavior is the same as described initially.

MrDiscret commented 6 years ago

It seems that changing the remote location from Z:\xampp\htdocs\myproject to Z:\htdocs\myproject works.

The files are now being saved properly. Existing files are being copied to the remote location upon saving. Furthermore, new files are being copied during the first save as.

I just wish I could use the very same directory structure in both locations... That is -- in my case -- \xampp\htdocs\myproject instead of \htdocs\myproject

chcg commented 6 years ago

@MrDiscret See https://ashkulz.github.io/NppFTP/ how the caching works.

When downloading files from a server, they are by default stored in the cache. When a file in the cache is saved, it will automatically be uploaded.

You have to define your own cache path under profile settings to use C:\xampp\htdocs as cache.