We help IT Professionals succeed at work.

idFTP Upload from Listbox

ST3VO
ST3VO asked
on
2,351 Views
Last Modified: 2010-08-05
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

Comment
Watch Question

Top Expert 2007

Commented:
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

Commented:
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

Author

Commented:
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
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
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

Author

Commented:
Thanks John!!! :o)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.