Re: how can i create a directory tree using Tidftp?

Giganews Newsgroups
Subject: Re: how can i create a directory tree using Tidftp?
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Mon, 7 Dec 2009

"Marcelo Varela da Silva" <marcelovarelasil…@yahoo.com.br> wrote in =
message news:EFD027EB049BE340marcelovarelasil…@yahoo.com.br...

> I would like know how can i create a directory tree in the
> server using Tidftp?.

You have to create each folder individually.  For example, if you want =
to create '/root/folder1/folder2', then you have to do something like =
this:

IdFTP1.ChangeDir('/root').
IdFTP1.MakeDir('folder1')
IdFTP1.ChangeDir('folder1');
IdFTP1.MakeDir('folder2')
IdFTP1.ChangeDir('folder2');
// upload to folder2 as needed...

> Using Delphi on local access I do : ForceDirectories(edtTree.Text)

ForceDirectories() does something similar to the above logic, but does =
so in a recursive loop.  If you want to be able to create arbitrary =
folder paths, you will have to execute the above logic recursively as =
well.

> but i don't know how can i do it so easy in the FTP server using =
TidFtp.

You would have to implement such a function manually.

--=20
Remy Lebeau (TeamB)

Replies

In response to

how can i create a directory tree using Tidftp? posted by Marcelo Varela da Silva on Sat, 5 Dec 2009