Supported from HBuilderX 2.7.12+

1. About sftp/ftp

HBuilderX optimized SFTP/FTP plugin from version 2.7.12+.

SFTP/FTP Installation

This plugin is a popular ftp plugin in vscode. Because HBuilderX is compatible with part of the plugin ecology of vscode, it can also be used in HBuilderX.

  • Use this plug-in to synchronize local workspace files with FTP server or Linux server files
  • Support ftp/sftp protocol
  • Support remote file directory browse, upload, download, delete
  • Support auto save upload

2. sftp/ftp introduction

Steps:

  1. As shown in the figure below, in the project manager, create an empty directory or empty project, and then select.
  2. Right-click menu, click [Ftp: Create connection configuration].
  3. The system automatically creates the .ftp/ftp-sync.json configuration file.
  4. Edit ftp-sync.json, enterhost(ip)usernamepasswordportprotocol.
  5. After filling in the configuration file, right-click the menu and click [Ftp:browse remote files].
  6. Select the file directory and perform the operations of upload, download, and delete.

2.1 Setup ftp/sftp configuration file

1. About sftp/ftp - 图1

2.2 Sync directory

  • Sync from remote to local
  • Sync from local to remote server

1. About sftp/ftp - 图2

2.3 Edit remote files locally, delete remote files

Select an item from project manager and right-click the menu [FTP: browse remote files] to open the SFTP view.

1. About sftp/ftp - 图3

3. ftp configuration file parameter description

  1. {
  2. "name": "Linux Testing Server",
  3. "host": "ip",
  4. "protocol": "sftp",
  5. "port": 22,
  6. "username": "username",
  7. "password": "password",
  8. "remotePath": "remote directory",
  9. "uploadOnSave": false
  10. }

Note:The configuration file is an ordinary json file placed under the project, which stores the ftp account. If your project uses the third party node library, please pay attention to its reliability to avoid the theft of ftp accounts

4. ftp、sftp agreement description

Support Ftp、Sftp 2 protocol.

If the remote server has set up the ftp service, username and password need to fill in the ftp user password.

sftp doesn’t need any configuration. Turning on SSH will enable SFTP by default. In other words, if your remote server is a linux system, even if the ftp service is not set up, you can still connect via sftp and use the file synchronization service.

  • SSH/SFTP,default port:22
  • Use sftp service, you need to fill in the user and password of the target computer.

5. ftp/sftp menu configuration shortcuts

Menu [Tool] [Custom Keybindings],you can configure shortcut keys for sftp related menus.

The details are as follows, you can change the key value to the shortcut key you want.

  1. [
  2. // Browse remote files
  3. {
  4. "key": "ctrl+shift+w",
  5. "command": "sftp.revealInRemoteExplorer"
  6. },
  7. // Synchronize remote data to local
  8. {
  9. "key": "ctrl+shift+r",
  10. "command": "sftp.sync.remoteToLocal"
  11. },
  12. // Synchronize local data to remote
  13. {
  14. "key": "ctrl+shift+l",
  15. "command": "sftp.sync.localToRemote"
  16. },
  17. // Upload the current folder
  18. {
  19. "key": "ctrl+shift+h",
  20. "command": "sftp.upload.folder"
  21. },
  22. // Download the current folder
  23. {
  24. "key": "ctrl+shift+q",
  25. "command": "sftp.download.folder"
  26. },
  27. // In project manager, right-click menu Ftp: Upload the current file
  28. {
  29. "key": "ctrl+shift+u",
  30. "command": "sftp.upload.file"
  31. },
  32. // Edit remote files locally
  33. {
  34. "key": "ctrl+shift+e",
  35. "command": "sftp.remoteExplorer.editInLocal"
  36. },
  37. // Delete remote files
  38. {
  39. "key": "ctrl+shift+d",
  40. "command": "sftp.delete.remote"
  41. },
  42. // Refresh
  43. {
  44. "key": "ctrl+shift+f",
  45. "command": "sftp.remoteExplorer.refresh"
  46. }
  47. ]