?
Solved

ftp files and folders nad subfolders

Posted on 2011-03-08
5
Medium Priority
?
467 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 56

Accepted Solution

by:
Bill Prew earned 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

741 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