in reply to Re: Re: Re: Re: Net::ftp - copy of file in cgi-bin
in thread Net::ftp - copy of file in cgi-bin

I'm going to hazard a guess that cgi-bin is where the script resides?

If so, and if you are not specifying an absolute path to your final destination, you could be pulling the file into a default location, which is the directory where the script resides. Or in the case of a cron job, the users home directory. Now, you could do a chdir() prior to invoking Net::FTP and put your process into the destination directory. Or, you might be able to specify where you want the file in your "GET" statement. Since you are only involving two servers, there really does not seem to be a need to do two FTP's.

You might try something like this:

chdir("/local/destination/for/file") or die "Cannot chdir $!"; $ftp->get("myfile.txt","my_new_file.txt");
or
$ftp->get("/remote/path/to/file/myfile.txt","/local/path/to/file/myfil +e.txt");
Does that help any? (I think I'm understanding what you are trying to do :)


"Ex libris un peut de tout"

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Net::ftp - copy of file in cgi-bin
by jonnyfolk (Vicar) on Oct 28, 2003 at 19:22 UTC
    Hi nimdokk, thanks for your input. I've had a play with your suggestions but nothing seems to have worked out yet. I'm going to leave it for now and get back to it tomorrow. I appreciate your help.