Indy FTP - 从当前文件夹导航到某个文件夹

Indy FTP - Navigating to a certain folder from current folder

您永远不会在 FTP 文件夹的根目录中上传文件。您始终有一个 'base' 或 'remote' 文件夹用于工作。在大多数情况下,这是 'public_html/domain.com'.

如何从随机的当前文件夹导航到特定文件夹,而无需一直导航到 FTP 根目录?某种 FTP.NavigateTo('downloads') 无论你现在在哪里,它总是从 'base' 文件夹开始导航。

我问这个是因为浏览几个文件夹比上传 HTML 文件需要更多时间!

最有效的导航方式(通过尽可能少的文件夹导航)是什么?

You never upload files in the root of an FTP folder. You always have a 'base' or 'remote' folder in which you work. In most cases this is 'public_html/domain.com'.

这完全取决于服务器的特定配置。我已经连接到(并写入)FTP 服务器,其中 "root" 文件夹映射到服务器文件系统上登录用户的主目录,因此直接上传到 "root" 是完美的可以接受。

How to navigate to a specific folder from a random current folder without navigating all the way down to FTP root?

只需提供到 TIdFTP.ChangeDir() 的绝对路径(相对于根目录)。 FTP 允许绝对导航和相对导航。

Some kind of FTP.NavigateTo('downloads') which will always start the navigation from 'base' folder no matter where you are now.

FTP.ChangeDir('/downloads');