自定义上传和下载
最后修改时间:2023 年 9 月 5 日除了确保在各种项目 - 服务器设置中成功上传和下载的强制设置之外,您还可以配置其他选项来自定义与服务器的交互。其中大多数选项适用于所有服务器访问配置类型。对于 FTP、FTPS 和 SFTP 服务器配置,您可以指定其他特定于协议的选项。
设置常用的上传和下载选项
按打开 IDE 设置,然后选择“构建”、“执行”、“部署”| 部署| 选项。CtrlAlt0S
或者,转到工具 | 部署| 选项...。
指定附加设置:
要在上传和下载过程中跳过特定文件或整个文件夹,请在“按名称排除项目”字段中指定定义这些文件和文件夹名称的模式。
使用分号
;
作为分隔符,使用星号*
来匹配零个或多个字符,使用问号?
来匹配单个字符。例如,如果您的文件夹stylesheets包含三个文件style.css、style1.css和style2.scss,则
style*
排除整个文件夹、style?.css
排除style.css以及style?.*
排除style1.css和style2.scss。从正则表达式.info了解更多信息。
排除是递归应用的。这意味着如果匹配的文件夹具有子文件夹,则也不会部署这些子文件夹的内容。
有关详细信息,请参阅从上传和下载中排除文件和文件夹。
通过选择或清除相应的复选框来指定上传和下载过程的详细信息。
指定其他特定于协议的自定义选项
按打开 IDE 设置,然后选择“构建”、“执行”、“部署”| 部署。CtrlAlt0S
或者,转到工具 | 部署| 配置...。
选择已配置的服务器并展开“连接”选项卡上的“高级”组以指定取决于协议的其他上传设置:
SFTP文件传输协议FTPS在“连接数”字段中,指定同时支持的最大连接数。
在每个发送保持活动消息字段中,指定您希望 PyCharm 向服务器发送命令以重置超时并从而保留连接的频率。
在客户端-服务器通信的编码字段中,指定与服务器使用的编码相匹配的编码。如果您不确定它是否支持UTF-8编码,请接受默认值。
要将客户端设置为被动模式,请选中被动模式复选框。在这种模式下,您机器上的客户端连接到服务器以告知自己处于被动模式,并接收要侦听的端口号,并通过接收到的端口号建立数据连接。当您的计算机位于防火墙后面时,此模式非常有用。
要在服务器浏览器工具窗口中显示隐藏文件和目录(名称以点开头),请选择“显示并处理隐藏文件”。
在使用 LIST 命令区域中选择与列出子文件的旧版本兼容,以确保子文件命名与 FTP 服务器的兼容性。
如果远程 FTP 服务器报告以下错误,此选项会很有帮助:
Invalid descendant file name <file name>
选择此选项可能会减慢与服务器的同步速度。
Select Instead of MLSD in the Use LIST command area to use the standard
LIST
command for listing instead of theMLSD
command. This lets you avoid problems, for example, failure during upload with the Invalid descendent file name exception if the FTP server supportsMLSD
and returnscdir
.In the Number of connections field, specify the maximum number of connections to be supported simultaneously.
In the Send keep alive messages each field, specify how often you want PyCharm to send commands to the server to reset the timeout and thus preserve the connection.
From the Keep alive command list, choose the commands to be sent to the server to reset the timeout and thus preserve the connection.
TLS: the method of Transfer Layer Security. Select Explicit to use the same port as Plain (unsecured) mode or Implicit to use a dedicated port.
Data channel protection level: select Clear for non-secured connection or Private for secured connection.
Reuse SSL session: select to reuse the security contract, including key and algorithm agreement information, established during SSL connection.
Disable TLS 1.3: select to disable TLS 1.3 features and have PyCharm fall back to connecting via TLS 1.2. Use this option if you experience issues with establishing a connection to a server or uploading certain files.
note
PyCharm supports connecting to servers via TLS 1.2 and later. Using TLS 1.0 and TLS 1.1 is not supported, since these protocols are deprecated and considered insecure.
To set the client to the passive mode, select the Passive mode checkbox. In this mode, the client on your machine connects to the server to inform about being in the passive mode, receives the port number to listen to, and established data connection through the port with the received number. This mode is helpful when your machine is behind a firewall.
To have the hidden files and directories (with names starting with a dot .) shown in the Server Browser Tool Window, select Show and process hidden files.
Select Compatible with old version of listing children in the Use LIST command area to ensure compatibility in child file naming with your FTP server.
This option is helpful if the remote FTP server reports the following error:
Invalid descendant file name <file name>
Selecting this option may slow down synchronization with the server.
Select Instead of MLSD in the Use LIST command area to use the standard
LIST
command for listing instead of theMLSD
command. This lets you avoid problems, for example, failure during upload with the Invalid descendent file name exception if the FTP server supportsMLSD
and returnscdir
.
感谢您的反馈意见!