in reply to Copying files between two systems using cgi/perl

Hi All,

Thanks for the many replies. Sorry .. I should have given
the full code, to avoid the confusion. The double backslashes
is infact in the code, so its not the issue.
Let me more elaborate..
my $sourcefile = 'c:/appl/process/attr_name.txt'; my $destination = '//System1/ShareDir'; $sourcefile = slashtobackslash($sourcefile); $destination = slashtobackslash($destination); system("copy $sourcefile $destination"); } sub slashtobackslash { my $value = $_[0]; $value =~ s-/-\\-g; return $value; }
I am processing the file at the server side, and trying to
copy to the target system. The target system has shared
directory which has full permissions. When I copy from the
server to this target system using copy command on command
line, that works fine and the user is any user(administrator,
or normal user which was being created).

Regarding the cgi program user, the explanation I got from
the IS group is may be the user might not have permissions,
to write into any system, may be for the security issues.
Well I wish I can be more specific, but as I am dealing
with server, I dont have direct access to it. All the
things I figured out till now are through cgi program and
interacting with some one on IS and getting the feedback !!!
Well about the return call of system command .. I will be
checking now.
IS dept. enabled the ftp from the server to the target system
to the specific directory and may be I can use net::ftp module
to implement this?
use Net::FTP; $ftp = Net::FTP->new("targetsystem", Debug => 0); $ftp->login("anonymous"); $ftp->put("c:\\test11.pl"); $ftp->quit;
I'm getting the following error ..
Use of uninitialized value in concatenation (.) or string
at C:/Perl/site/lib/Net/FTP.pm line 310.
Any ideas?

Thanks in advance,

Raj.

Replies are listed 'Best First'.
Re: Re: Copying files between two systems using cgi/perl
by thunders (Priest) on May 13, 2002 at 20:34 UTC
    if you look at the code for the module Net::FTP(In my computer it's in Perl/site/lib/Net/FTP.pm) that line number in within the login() subroutine, more specifically it's in an unless block that gets called if you don't define a password,which if you code is accurate, you have not done.
    The actual code tries to do some gobbledegook with getpwuid($>) and $ENV{HOME} if you're not running unix, this could generate an undefined value, hence the error.
    So I would just go ahead and login as anonymous with an email as a password, you skip over the error condition that way.
    $ftp->login("anonymous","myemailaddress@somewhere.com");