gpt4 book ai didi

delphi - delphi中ftp上传后的随机文件名

转载 作者:行者123 更新时间:2023-12-03 15:52:00 27 4
gpt4 key购买 nike

我正在开发一个需要将文件上传到服务器的应用程序。我正在使用delphi和TIDFtp上传文件。

一切正常,除了上传后的文件名是随机生成的。我的机器中的文件名为

test.txt

上传后其在服务器中的命名如 File name in the server after upload.

如何解决这个问题?

这是我的代码:

IdFtp1.Host := 'host';
IdFtp1.Username := 'uname';
IdFtp1.Password := 'pass';
IdFtp1.Connect;
IdFtp1.Put('test.txt');
IdFtp1.Disconnect;

最佳答案

Indy Put 方法有两个参数版本

试试这个

IdFtp1.Put('test.txt', 'remote-file.txt');

关于delphi - delphi中ftp上传后的随机文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30190987/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com