Failed to Change Directory - Indy 10 - Idftp

Asked

Viewed 1,456 times

1

The ftp folder is existing, I checked manually and even then this error occurs.

Folder on ftp:

inserir a descrição da imagem aqui

Then follow the code:

with IdFtp2 do
  begin
      Host := edtServFTP2.Text;
      Port := StrToInt(edtPorta2.Text);
      ReadTimeout := 0;
      Username := edtUser2.Text;
      Password := Lb3DES1.DecryptString(edtSenha2.Text);
      Passive := true;

      if Connected = false then
        Connect;

      ChangeDir('/RAMONRUAN/'); // a pasta onde vc

            //quer largar os arquivos

    if( ListBox1.Items.Count > 0 ) then//and (erro2 = '')then
    begin
      i := 0;
      while not (i = ListBox1.Items.Count) do
      begin
        try
          Put(ListBox1.Items[i]);
        except
          on e: Exception do ShowMessage('Não colocou o arquvio: '
            +ListBox1.Items[i]+' erro:'+e.Message);
        end;
        inc(i);
      end;
    end;

    IdFTP2.Disconnect;
  end;

What am I doing wrong?

  • On which line does the error point?

  • "Changedir('/RAMONRUAN/')"; only there, and as I said above, there is this directory.

  • Exactly, from this error "Failed to change directoy", there is possibility to be Indy?

  • @Qmechanic73, I do not use this function, at what point I could use it, or it is made from the moment I use the ChangeDir?

  • @Qmechanic73, returns from /var/ftp/MEU_FTP

  • Exactly. This way. That would be the problem?

  • 1

    @Ramonruan I don’t think so. Do you have access permissions to it? See if this directory appears when listing: IdFTP1.List(ListBox1.Items,'',false);

  • Got here friend, the problem was on which server I was connecting, then came up server folders that I didn’t want, it was just a second server that I had connected before

Show 3 more comments

1 answer

2

I know it’s old and solved, but in my example here I didn’t need to use the bars / . Only the name of the directory inside Changedir.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.