Ask a Question related to PERL Modules, Design and Development.
-
Morten Tangeraas #1
Net::FTP doesn't transfer files
I have a simpe script that is supose to upload a local file to a given
ftp server. There are no problems in logging in, and the file appears
on the remote ftp server, but the problem is that it contains no data.
The script runs perfectly on any other server, but not my FreeBSD
server. Here is the script:
#############################################
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use Net::FTP;
$ftp = Net::FTP->new("ftp.server.com");
$ftp->login("username","password");
#$ftp->binary;
#$ftp->put("/path/to/file.gif","file.gif") or die $ftp->message;
$ftp->quit;
print "DONE\n\n";
#############################################
When I run the script, it just hangs for a while (seems like a
timeout). The file name that was supose to be transfered, appears on
the remote ftp server right away, but as I said, it contains no data.
I've also run the FTP client app. on the FreeBSD server via SSH, works
fine! I've checked that the Net::FTP module is installed, and it is.
The strange thing is that it works, but just half way... I've also
tried to fetch files from the remote ftp server, without any luck...
Any suggestions on what the reason could be, or how I can figure out a
solution?
Thanks!
Regards,
Morten
Morten Tangeraas Guest
-
Transfer Printmaster files to In Design program
Can Printmaster 11 files be transfered to the In Design program. Printmaster files are in a pmo and an nws format? -
how to best transfer files between Mac and PC on a wireless LAN?
Hi all - I have a Mac laptop running OS9.2 (not OSX) and a PC laptop running Windows 2000. Both are on a wireless LAN in my house (connected to a... -
How to transfer data files...
I need help on file transfers, to and from, web servers to remote user computers. If anyone knows of a good reference I'd appreciate the tip. If... -
Files and Settings Transfer Wizard
Good Evening, I have the instructions from MS Knowledge Base Article (306187)for using the "Files and Settings Transfer Wizard" so I can make a... -
How to transfer files from PowerCenter 166 to G4
I am trying to transfer files from my old PowerCenter 166 to my G4 using an Ethernet cable. I did this a few years ago but have forgotten how to... -
Peter J. Acklam #2
Re: Net::FTP doesn't transfer files
[email]morten@tangeraas.com[/email] (Morten Tangeraas) wrote:
The first thing I'd do is to add "DEBUG => 1" to the constructor> I have a simpe script that is supose to upload a local file to a
> given ftp server. There are no problems in logging in, and the
> file appears on the remote ftp server, but the problem is that
> it contains no data. The script runs perfectly on any other
> server, but not my FreeBSD server. Here is the script:
to see what's going on.
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
Peter J. Acklam Guest
-
Robert Hjertmann Christiansen #3
Re: Net::FTP doesn't transfer files
Could it be that you have some firewall rules to block your passive
port. The Net::FTP module uses passive mode per default.
Try setting Passive => 0 in the common options. (see below)
Morten Tangeraas wrote:
> I have a simpe script that is supose to upload a local file to a given
> ftp server. There are no problems in logging in, and the file appears
> on the remote ftp server, but the problem is that it contains no data.
> The script runs perfectly on any other server, but not my FreeBSD
> server. Here is the script:
>
> #############################################
>
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
>
> use Net::FTP;
>shoud be> $ftp = Net::FTP->new("ftp.server.com");
$ftp = Net::FTP->new("ftp.server.com", Passive => 0);
for non passive mode.
--> $ftp->login("username","password");
>
> #$ftp->binary;
> #$ftp->put("/path/to/file.gif","file.gif") or die $ftp->message;
>
> $ftp->quit;
>
> print "DONE\n\n";
>
> #############################################
>
> When I run the script, it just hangs for a while (seems like a
> timeout). The file name that was supose to be transfered, appears on
> the remote ftp server right away, but as I said, it contains no data.
>
> I've also run the FTP client app. on the FreeBSD server via SSH, works
> fine! I've checked that the Net::FTP module is installed, and it is.
> The strange thing is that it works, but just half way... I've also
> tried to fetch files from the remote ftp server, without any luck...
>
> Any suggestions on what the reason could be, or how I can figure out a
> solution?
>
> Thanks!
>
> Regards,
> Morten
Robert Hjertmann Christiansen
Technical University of Denmark
Robert Hjertmann Christiansen Guest
-
Morten Tangeraas #4
Re: Net::FTP doesn't transfer files
Robert Hjertmann Christiansen <robert@hjertmann.dk> wrote in message news:<bo88uu$1hu6$1@gnd.k-net.dk>...
No difference, unfortunately... I've also tried to fetch a list of> Could it be that you have some firewall rules to block your passive
> port. The Net::FTP module uses passive mode per default.
> Try setting Passive => 0 in the common options. (see below)
files from the FTP server. I tried the Debug option, but no error
message... this is the message log from the FTP server:
junior Microsoft FTP Service (Version 3.0).
User xxxxxxxx logged in.
Type set to I.
CWD command successful.
CWD command successful.
Opening BINARY mode data connection for file list.
DONE
Seems like it times out after some time (about two minutes), when it
comes to transfering file data or file lists and stuff like that...
But the script completes, since the last print "DONE"; on the end of
the script prints DONE on the end of what is printed...
I don't think the server is behind a firewall, since all functions in
the buildt in ftp application in FreeBSD works fine...
Morten
Morten Tangeraas Guest
-
Jeff Drumm #5
Re: Net::FTP doesn't transfer files
On 3 Nov 2003 05:50:04 -0800, Morten Tangeraas <morten@tangeraas.com> wrote:
(snip)
Um, I think the fact that these two lines are commented out might> #$ftp->binary;
> #$ftp->put("/path/to/file.gif","file.gif") or die $ftp->message;
have something to do with it.
--
- Jeff
Jeff Drumm Guest
-
Morten Tangeraas #6
Re: Net::FTP doesn't transfer files
[email]jdrumm@FOAD-you-evil-spammer-bastards.com[/email] (Jeff Drumm) wrote in message news:<G_ydnWeRTobcJDaiRVn-sw@suscom-maine.net>...
I just figured it out (me dummie)... The Passive had to be set to 1, not 0, like> On 3 Nov 2003 05:50:04 -0800, Morten Tangeraas <morten@tangeraas.com> wrote:
>
> (snip)
>>> > #$ftp->binary;
> > #$ftp->put("/path/to/file.gif","file.gif") or die $ftp->message;
> Um, I think the fact that these two lines are commented out might
> have something to do with it.
Passive => 1
.... and now it's working!!!!! Thanks for all your help, folks!
Regards,
Morten
Morten Tangeraas Guest



Reply With Quote

