Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 865071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:34:58+00:00 2026-05-15T09:34:58+00:00

I need to move or copy a simple text file from one web site

  • 0

I need to move or copy a simple text file from one web site to another web site.
I have administrator rights to both web sites. The first web site has a large data file (again, just a text file), certain records are selected and written to a team file (for entry into a tournament). Next I go through paypal and pay for the entries. The second site is for the the club running the tournament and I use IPN to return to a script on their site and if it verified, I add the team memebers into the master file for the tournament. I am limited to the ONE IPN script on the tournament site because I have a ton of other entries that come in from all over. The first site has the rosters for the state and no need to type all that data from each club, use the rosters like I use for all the non-paypal tounamenmts.
I can ftp the team file to the second server and place it in the folder just like it was created from scratch from that server originally and everything should go fine but I took the examples and tried them and nothing.
Here’s the code section:

my  $custom = $in->param('custom');
my  $filename = "$ENV{DOCUMENT_ROOT}/database/$custom";

my  $usjochost = '208.109.14.105'; 
my  $okserieshost = '208.109.181.196'; 

my  $usjocuser = 'teamentry'; 
my  $okseriesuser = 'okwaentry'; 

my  $usjocpw   = 'Password1'; 
my  $okseriespw   = 'Password1'; 

my  $file = $custom; 

my  $usjocpath ='/home/content/u/s/j/usjoc/html/database/'; 
my  $okseriespath ='/home/content/o/k/s/okseries/html/database/'; 

$ftp = Net::FTP->new($okserieshost, Debug => 0)  or die "Could not connect to '$okserieshost': $@"; 

$ftp->login($okseriesuser, $okseriespw) or die sprintf "Could not login: %s", $ftp->message; 

#$ftp->cwd(/database)  or die sprintf "Could not login: %s", $ftp->message; 
$ftp->get($filename);

#$ftp = Net::FTP->new($usjochost, Debug => 0)  or die "Could not connect to '$usjochost': $@"; 

$ftp->quit;

I NEED to READ the file on the first web site (okseries.com) and write the file on the second web site (usjoc.com). I have no problem reading and writing the file on the server, is sending the file to the second server. HELP! I’m not a genius at PERL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:34:59+00:00Added an answer on May 15, 2026 at 9:34 am

    i tested the code you made and implemented to it, the follow code will connect to your first host, okserieshost and get the $filename from database folder, verify if the file was downloaded (if not it will end operations).

    #!/usr/bin/perl
    
    use Net::FTP;
    
    my  $path     = '/public_html/api';
    my  $filename = 'index.php';
    
    my  $host = '';
    my  $user = '';
    my  $pass = '';
    
    print "Content-type: text/html\n\n"; 
    $ftp = Net::FTP->new($host, Debug => 0)  or die "Could not connect to $host: $@";
    print "<pre>".$ftp->message ."</pre><br>\n";
    $ftp->login($user,$pass) or die sprintf "Could not login: %s", $ftp->message;
    print "<pre>".$ftp->message ."</pre><br>\n";
    my $cur = $ftp->pwd();
    my $new = $ftp->cwd($path);
    
    if ($cur == $new) {
        $ftp->quit;
        print "Directory not found, exiting.\n";
    } else {
        if ($ftp->size($path.'/'.$filename) >= 0) {
            $ftp->get($path.'/'.$filename) or die $ftp->message;
            print "<pre>".$ftp->message ."</pre><br>\n";
            print "File downloaded with success." if (-e $filename);
        } else {
            print "File not found.\n";
        }
    }
    
    $ftp->quit;
    

    i’ve changed the code a little you can put this file on usjoc.com and run it on the browser it wil display every step of the communication until it gets the file from okseries.com.
    All you have to do is change $path to the path of where the file is but do not end the directory name with a /
    filename in case on $filename
    $host = ftp ip or hostname
    $uesr and $pass i guess you know what goes in

    response from the url you asked to be viewed:

    USJOC Entry Form on
    
    
    
    The Club file name is EdmondSkunks1T.db
    /home/content/o/k/s/okseries/html/database/EdmondSkunks1T.db
    Supposedly opened /home/content/o/k/s/okseries/html/database/EdmondSkunks1T.db
    Back to USJOC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.