CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Downloading file to local directory



Jun 3, 2009, 1:33 PM

Post #1 of 1 (326 views)
Downloading file to local directory Can't Post

I have a file say at the following location on an ftp server

I am downloading the file and storing it on my local machine. I want it to store it with the same folder hierarchy. For example, suppose my current folder is C: so after my code runs, the file should be at the following location,

The following is the code that i have written, but it is giving the following error:
Cannot open Local file C:/edgar/full-index/1993/QTR1: No such file or directory
at line 42

use Net::FTP;
use strict;

my $start_year = 1993;
my $start_qtr = 1;

$ftp = Net::FTP->new(HOST) or die;
$ftp->cwd("/edgar/full-index/$start_year/QTR$start_qtr") or die "$@";

$ftp->get('master.idx',"C:/edgar/full-index/$start_year/QTR$start_qtr") or die


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives