Solved

ftp files and folders nad subfolders

Posted on 2011-03-08
5
463 Views
Last Modified: 2012-05-11
Does anyone have a script or know how to login to an FTP site and download all files folders and subfolders?

thanks
0
Comment
Question by:SteveSext
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Scovndrel
ID: 35079728
http://support.microsoft.com/kb/96269

FTP is capable of using scripts (lists of commands from external files). The following example demonstrates a script that opens a connection to IP address 11.11.11.11, logs on to the host as a guest with the password "guest," uploads the File1 file, and then quits:

open 11.11.11.11
user
guest
guest
put file1
quit

You must use the -s option for FTP to read this file under Windows. If the previous script was in a file called Test.scr, you can start the script by typing:

ftp -s:test.scr

You can specify the host name in the command line and then use the script to process the login. For example, if you use the following command line

ftp -s:test.scr 11.11.11.11

the script file should read as follows:
user
guest
guest
put file1
quit

However, if the FTP host implements automatic login, this command will not work. To turn off automatic login, use the -n switch in the command line as follows:
ftp -n -s:test.scr 11.11.11.11
0
 

Author Comment

by:SteveSext
ID: 35080546
thanks for that, if the site contains multiple files and folders, do you know how to download everything without being prompted for 'y' ?
0
 
LVL 4

Expert Comment

by:Scovndrel
ID: 35080578
I believe you use the "mget" command, for "get multiple files", and the next line on the script under the mget is a "y" all by itself, on that line, no quotes. The y by itself is the way to answer any prompts that you know will require it.
0
 

Author Comment

by:SteveSext
ID: 35081097
How can I download all subfolders as well? I think mget gets files only?
0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 35082363
There is no native support for recursive file transfers in the basic FTP clients that are typically available.  With some scripting, or ZIPing up the files before the xfer you can move entire folder structures.

My preference is to use an FTP client though that adds this capability, like NCFTPGET.  It's free and a single command line can pull an entire folder tree.  There are other solutions that can do this as well.

http://www.ncftp.com/ncftp/doc/ncftpget.html

~bp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
collection output issue 9 63
Mutiple Folder view (5 Folder view) 3 51
Decommissioning DNS server question 3 33
Problem to Citrix 2 15
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question