in reply to Error ftping file with Net::FTP
Hello Anonymous Monk,
Try something like this:
#!/usr/bin/perl use CGI; use strict; use warnings; use Net::FTP; use feature 'say'; my $cgi = CGI->new(); my $file = $cgi->param( 'upload' ) || 'test.pl'; say do_ftp($file); sub do_ftp { my ($filename) = @_; return unless $filename ; } __END__ $ perl ftp.pl test.pl
We do not have the full code but I assume my $file = $cgi->param( 'upload' ) || ''; that you are passing an empty string here right? I have alter the code in two points. Observe the () in the subroutine also.
I would recommend to use module Net::SFTP::Foreign. Similar question with samples of working code(s) Generate temporary file and FTP upload.
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error ftping file with Net::FTP
by Anonymous Monk on Aug 16, 2017 at 15:06 UTC | |
|
Re^2: Error ftping file with Net::FTP
by Anonymous Monk on Aug 16, 2017 at 15:54 UTC | |
by hippo (Archbishop) on Aug 16, 2017 at 16:08 UTC | |
by Anonymous Monk on Aug 16, 2017 at 17:25 UTC |