有什么办法在delphi上使用不安全的FTP连接(noTLS)?

时间:2018-02-05 23:40:42

标签: delphi ftp

我正在使用Delphi开发一个Android应用程序。我的ftp服务器出了问题。对于任何我不知道的reasson,它只接受标准的ftp连接(没有TLS)。我使用以下代码收到超时错误

function uploadfile(imagetoload:TBitmap;place_id:string):boolean;
var
  filename:String;
  url,imagepath:string;
  FTP: TIdFTP;
begin
  try
    try
      filename:='PPic-'+user_id+'-'+DateToStr(today)+TimeToStr(Today)+'.jpg';
      filename:=replacetext(filename,'/','-');
      filename:=replacetext(filename,':','-');
    imagepath:=system.IOUtils.TPath.Combine(system.IOUtils.TPath.GetDocumentsPath,filename);
      imagetoload.SaveToFile(imagepath);
      ftp := TidFTP.Create(Nil);
      ftp.Host:=FTPSERVER;
      ftp.Username:=FTPUSR;
      ftp.Password:=FTPPWD;
      ftp.Passive := True;
      ftp.ConnectTimeout := 6000;
      ftp.Connect;

我尝试使用filezilla连接到ftp服务器,只在选择普通ftp连接时才接受连接。

有没有办法与TIdFTP使用不安全(无TLS)连接?

非常感谢。

1 个答案:

答案 0 :(得分:0)

我的服务器上的ssl证书似乎有问题所以最后我编写了一个php函数来上传图片。

感谢您的支持。