From owner-freebsd-questions Wed Aug 2 10:14:11 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by hub.freebsd.org (Postfix) with ESMTP id 73BAB37B5FB for ; Wed, 2 Aug 2000 10:13:42 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.9.3/8.9.3) with ESMTP id OAA73734; Wed, 2 Aug 2000 14:16:14 GMT (envelope-from fgleiser@cactus.fi.uba.ar) Date: Wed, 2 Aug 2000 14:16:14 +0000 (GMT) From: Fernando Gleiser To: Nathan Vidican Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ftp upload from script In-Reply-To: <398739CC.713D40B3@wmptl.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 1 Aug 2000, Nathan Vidican wrote: > I need to have a script upload three files via FTP, is there anyway of > doing this from a script? for example: > > foreach $filename (@files) { > system("ftp username:pass@ftp.wmptl.net/directory/to/ftp/to < > $filename"); > } > If you are using it in a perl script, you may try the Net::FTP module (available from the ports as part of p5-Net-1.0607). to upload a file(stol^Wborrowed from the man page): use Net::FTP; my $ftp=Net::FTP->new("your remote host"); $ftp->login("remoteuser", "remotepass"); $ftp->put("yourfile"); $ftp->quit; Hope this helps Fer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message