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

  • Home
  • SEARCH
  • 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 9139431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:23:12+00:00 2026-06-17T09:23:12+00:00

My problem is about using perl to ftp a local file to the ftp

  • 0

My problem is about using perl to ftp a local file to the ftp server. The question is why the upload speed is so slow. Here is code:

use strict;
use warning;

use NET::FTP;

my $ftpserver = "10.110.143.9";
my $usr       = "John";
my $passwd    = "John";

sub main {
    my $ftp = Net::FTP->new( $ftpserver, Timeout => 200 ) or print "Can't connect ftpserver" sleep 5;
    my $rc = $ftp->login( $usr, $passwd );
    unless ($rc) {
        print("login failed!");
        return 1;
    }
    print("login success");
    $ftp->binary();
    $ftp->put("d:\\2012.txt");
    $ftp->quit;
    return 0;
}

Upload times for 30mb are about 5 minutes while using another ftp client on the same machine takes only 10 seconds or so.

  • 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-06-17T09:23:13+00:00Added an answer on June 17, 2026 at 9:23 am

    You should enable PassiveMode, and also play with BlockSize (it used to be a source for slowdown with Net::FTP), something like this:

    my $ftp = new Net::FTP(
        $ftpserver,
        Timeout => 200,
        Passive => 1,
        BlockSize => 8192,
    );
    

    Try increasing (or decreasing) BlockSize by factor of 2 few times and see if it changes anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm having a weird problem about copying with Xcopy. I'm using Windows Server 2008
I ask a question about using XPath function there But I meet a problem
Due to the problem I posted here Mootools when using For(...in Array) problem about
I am trying to write a Perl script using WWW-Mechanize. Here is my code:
I have a little problem about using jQuery (I really do not know jQuery
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I am using MFC CFile Seek function. I have a problem about Seek out
I have successfully implemented a cel shader using glsl. But my problem is about
I'm learning about Singleton pattern using GoF's book. I have a problem when I
I'm new to SVN and I'm quite confused about a problem. I am using

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.