emilford has asked for the wisdom of the Perl Monks concerning the following question:
When I run this and make a call to this sub routine the show_error function prints the error "No such directory". Is this referring to the local or remote server? Everything else prior to file upload works. What am I doing wrong?sub upload_image() { use Net::FTP; my $path = $_[0]; # path received from HTML form input - location o +f image on local machine my ($username, $password, $directory) = ("xxxx", "xxxx", "/www/path/to +/store/files"); my $ftp = Net::FTP->new("www.xxxxxxxx.net", Timeout => 30, Debug => 1) || die &show_error("Unable +to connect to ftp: $!"); $ftp->login($username, $password) || die &show_error("Unable to lo +gin to ftp: $!"); $ftp->cwd($directory) || die &show_error("Unable to change directo +ry: $!"); $ftp->put($path) || die &show_error("Unable to upload $path: $!"); $ftp->quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Image Upload
by rob_au (Abbot) on Apr 03, 2002 at 07:16 UTC | |
by tachyon (Chancellor) on Apr 03, 2002 at 08:43 UTC | |
by kappa (Chaplain) on Apr 03, 2002 at 12:02 UTC | |
by emilford (Friar) on Apr 03, 2002 at 19:50 UTC |