Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload on Save doesnt work #154

Closed
perfecto25 opened this issue Apr 21, 2017 · 28 comments
Closed

Upload on Save doesnt work #154

perfecto25 opened this issue Apr 21, 2017 · 28 comments

Comments

@perfecto25
Copy link

perfecto25 commented Apr 21, 2017

running VS Code on centos 7, my ftp-sync.json

{
"remotePath": "/opt",
"host": "ny02",
"username": "root",
"password": "",
"port": 22,
"secure": true,
"protocol": "sftp",
"uploadOnSave": true,
"passive": false,
"debug": true,
"privateKeyPath": "/root/.ssh/id_rsa",
"passphrase": null,
"ignore": [
"\.vscode",
"\.git",
"\.DS_Store"
],
"generatedFiles": {
"uploadOnSave": true,
"extensionsToInclude": [],
"path": ""
}
}

every time i save a local file, it doesnt get FTPd to the target. I have to do this manually. Am I missing a param?

@paulmichaeldev
Copy link

Same thing here on Windows 10.

@jhvanderschee
Copy link

Same on Linux

@amartacus
Copy link

amartacus commented Apr 24, 2017

It seems like the Visual Studio Code 1.11 update broke the upload on save functionality. :(

@amartacus
Copy link

Update - FYI, try reinstalling the extension. After upgrading to VS Code 1.11 I was able to get ftp-sync to start working again.

@paulmichaeldev
Copy link

Mine was on a fresh install of VS Code, as I had never used it before and wanted to see if it was feasible to move from PHPStorm.

@perfecto25
Copy link
Author

perfecto25 commented Apr 24, 2017

Im running VSCode 1.11.2, FTP Sync version 0.3.3, centos 7 x 64

reinstalled the ftp sync ext, problem persists, changes made to a file, file is saved, no syncing is done with remote location, I have to manually right click on the file and select 'Ftp-Sync: Upload File/Folder'

screenshots,

  1. created new file called test_sync.txt, added text
    sync1

  2. saved file. Sync is supposed to take place at this point. File is not generated on remote location
    sync2

3 running manual sync
sync3

  1. file is uploaded via manual sync (no errors w permissions, network, etc)
    sync4

@fmrogers
Copy link

Not sure if this will help but after reinstalling VS Code (and deleting the setting folder from my user folder), i finally got it working again.

Also these new lines in the confguration:

"generatedFiles": {
"uploadOnSave": true,
"extensionsToInclude": [],
"path": ""
}

This may be incidental but i set the "path" property to the local path of my project. ie' "D:/foo/bar/".

Not sure if it was the reinstall or the change in "path" but it's all working again for me. Maybe somebody will find this useful.

@paulmichaeldev
Copy link

I think I'll just stick to PHPStorm :-)

@ghost
Copy link

ghost commented Apr 28, 2017

I think i found the problem, if uploadOnSave is set to true inside the generatedFiles configuration the file gets ignored unless you specify the extension in the "extensionsToInclude" array, i don't know if this is working as intended, copying @jsmilovic to figure this out.

For now i suggest you guys just set the uploadOnSave option to false inside the generatedFiles subsection and everything should be ok, please let me know if this helps you!

edit: with more testing i found out that if you put a value inside the "path" variable in the generatedFiles section everything gets uploaded properly, i'm going to post a tentative fix to this problem soon by putting an if-clause that excludes the break if the path is empty (at the moment an empty path value basically makes the whole project a generated file dir)

@ghost ghost closed this as completed in 59be0ee Apr 28, 2017
@ghost ghost reopened this Apr 28, 2017
@ghost
Copy link

ghost commented Apr 28, 2017

i just committed a fix on the main branch, please let me know if the feature is now working again

Thank you

@perfecto25
Copy link
Author

that worked. thanks for the tip!

@ghost ghost closed this as completed Apr 28, 2017
@AmitKKhanchandani
Copy link

facing the same issue on VSCode 1.15.1 and FTP-sync 0.3.3

anyone else facing this on the latest version of VSCode, i installed this extension yesterday

@votvas
Copy link

votvas commented Aug 31, 2017

.vscode/ftp-sync.json needs the current working path in generatedFiles :

... "generatedFiles": { "uploadOnSave": true, "extensionsToInclude": [], "path": "C:/Users/XXXX/Documents/VSCODE/XXXXX/" } }

Windows 10, VSCode 1.15.1 and FTP-sync 0.3.3

@vilcuRob
Copy link

@kalieye Thanks! that was it for me - maybe worth updating the description:
https://marketplace.visualstudio.com/items?itemName=lukasz-wronski.ftp-sync

@Zamiell
Copy link

Zamiell commented Jul 13, 2018

I'm a first time VSCode user, and the first thing I needed was an FTP extension. vscode-ftp-sync seemed to be the most popular one, so I downloaded it to give it a try.

After setting uploadOnSave to true in my ftp-sync.json file, it did not work, so I went online to do some searching. I stumbled upon this page, which gave me the fix: to turn the second uploadOnSave value inside thegeneratedFiles object to be false.

@kalieye I think that the extension could extra logic to better handle this, as the UX for new users is quite frustrating in this regard. Perhaps a helpful thing would be for the extension to automatically ignore the the second uploadOnSave value if the first one is set to true, or something along those lines?

@ghost
Copy link

ghost commented Sep 1, 2018

Hi guys!

I had the same situation and after setting the extensionsToInclude in generatedFiles automatic upload on save is working again.

In my case this is how I set it up:

"generatedFiles": {
        "uploadOnSave": true,
        "extensionsToInclude": [".php",".html"],
        "path": ""
    }

I am running VS Code 1.26.1 and ftp-sync 0.3.3

Ivan

@merabchik
Copy link

It's not working again in VS code Version: 1.33.0 :(

@venoel
Copy link

venoel commented Sep 12, 2019

I have opposite situation. I set
"uploadOnSave": false,
but files still auto uploads.
Ubuntu 18.04, VSCode v 1.38.1, ftp-sync v 0.3.9

Ftp-sync version 0.3.8 does not have this problem.

@movsar
Copy link

movsar commented Sep 22, 2019

Version 0.3.9 - automatic upload works once and then stucks when trying for the consequent times. It doesn't work until I restart the VSC. Thanks for the extension though, it's VERY USEFUL!

@aolamer
Copy link

aolamer commented Oct 15, 2019

I had this situation and used "/" slash for the path in "generatedfiles" section and auto upload works well now
"generatedFiles": {
"extensionsToInclude": [],
"path": "/"
}

@kinwebdesign
Copy link

Restarting VSCode seemed to work for me 🤷

@cengizhan
Copy link

cengizhan commented Dec 2, 2019

I have opposite situation. I set
"uploadOnSave": false,
but files still auto uploads.
Ubuntu 18.04, VSCode v 1.38.1, ftp-sync v 0.3.9

Ftp-sync version 0.3.8 does not have this problem.

i also have this problem. i don't want my local files to be automatically uploaded. this breaks my project. i am going to disable it until it is resolved.

windows 10, vscode 1.40.2

@BidSob
Copy link

BidSob commented Apr 10, 2020

I have opposite situation. I set
"uploadOnSave": false,
but files still auto uploads.
Ubuntu 18.04, VSCode v 1.38.1, ftp-sync v 0.3.9
Ftp-sync version 0.3.8 does not have this problem.

i also have this problem. i don't want my local files to be automatically uploaded. this breaks my project. i am going to disable it until it is resolved.

windows 10, vscode 1.40.2

Me too in 1.44.0

@giacomopittalis
Copy link

I have opposite situation. I set
"uploadOnSave": false,
but files still auto uploads.
Ubuntu 18.04, VSCode v 1.38.1, ftp-sync v 0.3.9
Ftp-sync version 0.3.8 does not have this problem.

i also have this problem. i don't want my local files to be automatically uploaded. this breaks my project. i am going to disable it until it is resolved.
windows 10, vscode 1.40.2

Me too in 1.44.0

Same here: win 10 vscode 1.45.1

@ProStudioMe
Copy link

I had this situation and used "/" slash for the path in "generatedfiles" section and auto upload works well now
"generatedFiles": {
"extensionsToInclude": [],
"path": "/"
}

This worked for me

@murad-faridi
Copy link

murad-faridi commented Oct 13, 2021

Edit the following file to FIX:-

For Windows: C:\Users\(user)\.vscode\extensions\lukasz-wronski.ftp-sync-0.3.9\modules\on-generate.js
For Linux: home/(user)/.vscode/extensions/lukasz-wronski.ftp-sync-0.3.9/modules/on-generate.js

File will look like this:

module.exports = function(document, getFtpSync, skipOnSaveCheck) {
if (document.uri.fsPath.indexOf(ftpconfig.rootPath().fsPath) < 0) return;
var config = ftpconfig.getConfig();

if (!config.uploadOnSave) return; // <------ ADD THIS LINE TO FIX

@szojox
Copy link

szojox commented Aug 11, 2022

Edit the following file to FIX:-

For Windows: C:\Users\(user)\.vscode\extensions\lukasz-wronski.ftp-sync-0.3.9\modules\on-generate.js For Linux: home/(user)/.vscode/extensions/lukasz-wronski.ftp-sync-0.3.9/modules/on-generate.js

File will look like this:

module.exports = function(document, getFtpSync, skipOnSaveCheck) {
if (document.uri.fsPath.indexOf(ftpconfig.rootPath().fsPath) < 0) return;
var config = ftpconfig.getConfig();

if (!config.uploadOnSave) return; // <------ ADD THIS LINE TO FIX

Just use simple workaround
in settings.json - main for vscode add ->
"editor.codeActionsOnSave": { "extension.ftpsyncsingle": true }

it will sync every file on save

@deltemp
Copy link

deltemp commented Sep 14, 2023

"Workspace": {
"OS": "Both Windows 11 and Pop_OS! 22.04 LTS",
"vscode": "1.82.1",
"ftp-sync": "v0.3.9"
},
"Scenario 1": {
"uploadOnSave": false,
"Save the file",
"Right-click it",
"Choose 'Ftp-sync: Upload File' from the context menu",
"It works instantly! :-D"
},
"Scenario 2": {
"uploadOnSave": true, // using any of the above presented solutions
"Save the file",
"Status bar freezes with: 'Ftp-sync: Uploading file.php to FTP server...'",
"Nothing ever happens again! :_("
}

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests