Link to home
Start Free TrialLog in
Avatar of ST3VO
ST3VOFlag for United Kingdom of Great Britain and Northern Ireland

asked on

idFTP Upload from Listbox

Hi experts,

I need to upload using idFTP a list of files which are populated inside a listbox.

The problem is that I need to create the folder on the FTO site if it doesn't exists.

For example:

ftp://whatever//images/bikes/123.jpg

Let's supports the folder bikes does not exists...then I need it to create it and upload the 123.jpg file.

Basically I need it in a loop so all the list from the listbox is uploaded.

Hope you can help!

Thanks

ST3VO

Avatar of imitchie
imitchie
Flag of New Zealand image

try creating a try-except around all directory creates
i.e. If you know you can log into ftp://whatever/  (root), fire try-excepted mkdir images, then cd images, then mkdir bikes, then cd bikes...
looks like a lot of useless traffic, but it seems to work
St3vo,

Do you have another listbox with the locations of the files to be uploaded or are they just in one directory on your local machine? Just need to know where thos files being FTPed are coming from.

The problem is two fold, parsing the FTP list for just the one directory and checking if a directory exists since IdFTP does not have a Directory Exists type function. But I may have an idea on the FTP part. (Parsing has always been tough for me).

John

Avatar of ST3VO

ASKER

Hi John,

Yes I do have the whole url including the filename to be uploaded!

p.s: I'm currently banging my head and I'm about to break my pc into 1000000 piece :o/

I'm try to get Question: Q_23012985.html sorted :o(

Why are things always sooo complicated??? Grrr
ASKER CERTIFIED SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ST3VO,

THERE IS ONE CHANGE ... In the function:

IdFTPComp.List(DirList, DirName, False);

(within the FTPDirExists), change False to True, i.e.

IdFTPComp.List(DirList, DirName, TRUE);

True makes it silent.

I did test it within the FTP Client demo that Indy has in its Indy9 demo zip, but just wondering if it worked in your setting and situation..

Thanks. And Let me know when you can if this worked.

John
Avatar of ST3VO

ASKER

Thanks John!!! :o)