10-22-2008
Hi,
THanks for your advise. I tried to develop with Perl this code but I experienced some issues and I cannot retrieve a file from an FTP server (Unix) to a local disk (c:\) in a desktop(Windows).
Here is the code:
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
my $backup_dir = "C:/partage";
my $remote_backup_dir = "/home/toto";
my $remote_file = "toto.txt";
my $dir = "/home/toto";
my $ftp = Net::FTP->new("192.168.1.17", Passive => 1, Debug => 1);
$ftp->login('toto','pass10');
$ftp->cwd($dir) || die "Unable to change directories";
$ftp->binary();
$ftp->get($remote_file,"toto.txt");
$ftp->quit;
I get this error when I try to run this code from a website as:
http://192.168.1.17/cgi-bin/papa1.pl
and I get this error message:
Internal Server Error
Thanks in advance.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello All,
Currently working with CGI scripts in perl which involves
a) uploading
b) processing
c) downloading the file back to the user
uploading and processing quite trivial and they are done
Third part is kind of being tricky.
Excel file in binary format is getting displayed in the... (4 Replies)
Discussion started by: matrixmadhan
4 Replies
2. Shell Programming and Scripting
I want to automatically download a CSV file daily which can be found here:
London Stock Exchange - Search
and the link is named "Click to download covered warrants (100Kb)" on the right hand side.
What commands can I use to invoke clicking on this link and initiating the download? And also... (2 Replies)
Discussion started by: figaro
2 Replies
3. Shell Programming and Scripting
Hi,
I need to write a script to download a file (say http: //www.mysite.com/myfile.txt) from the internet (please note that the file is on http not ftp).
Please let me know if there is any method other than wget.
Thanks,
Chetan (4 Replies)
Discussion started by: chetanpc
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
Which command I can use to download a file from website?
I tried with wget and lwp-dowload but no gain.
Can any one suggest me the good way to dowload? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies
5. UNIX for Dummies Questions & Answers
Hi experts,
I've question in perl, i need to download a text file from the Web and save that content to the server, Is it possible in perl script or i need to do it in the excel. I tried in the excel but the alignment is missing there. Could you please help in find that.
Thanks
senthilkumar (0 Replies)
Discussion started by: senthil.ak
0 Replies
6. Shell Programming and Scripting
Im trying to write a perl code to do the following task.
I have a website which is located in a diffirent country.
I want to download a file from that site everyday.
The file name keeps on changing everyday.
say the file name is CTP-latest-5.3.0.37.iso
next day it may change to... (0 Replies)
Discussion started by: srijith
0 Replies
7. Windows & DOS: Issues & Discussions
I download a file (video) from youtube via IDM. What happens, it downloads completely but while running the video, I find that it isn't proper. The video won't be complete. for ex., a 10 minutes video which I downloaded now runs for 10 seconds only and then stops. So, may times I download the same... (1 Reply)
Discussion started by: ravisingh
1 Replies
8. Shell Programming and Scripting
Hi All ,
I need a help regarding file ftp ing from mainframe to unix.Our source file is mainframe file.I need to download the mainframe file to local unix server through unix script.If anyone can help me how we can do it through unix script ,it will be really helpful.Thanks. (7 Replies)
Discussion started by: STCET22
7 Replies
9. Shell Programming and Scripting
Hello All.
We are getting one zip file from another server daily. The size of the zip file will be around 4.5 gb that takes time to download completely. I have to process that file furthest once get downloaded completely. I have written one code for that, but i need suggestion whether it is a... (7 Replies)
Discussion started by: looney
7 Replies
10. UNIX for Beginners Questions & Answers
I saved to disk using lynx, under ls it shows up but no matter what I have done back comes the statment no such file.
How do you erase these ls false readings or open what ls shows? (9 Replies)
Discussion started by: Jackbird
9 Replies
LEARN ABOUT SUSE
simpleftp
SIMPLEFTP(1) InterNetNews Documentation SIMPLEFTP(1)
NAME
simpleftp - Rudimentary FTP client
SYNOPSIS
simpleftp url [...]
DESCRIPTION
simpleftp is a Perl script that provides basic support for fetching files with FTP in a batch oriented fashion. It takes one or more FTP
URLs on the command line. The file(s) will be retrieved from the remote server and placed in the current directory with the same basename
as on the remote; e.g., <ftp://ftp.isc.org/pub/usenet/CONFIG/active.gz> is stored as active.gz in the current directory.
The script properly understands usernames, passwords and ports specified as follows:
ftp://user:password@host:port/path/file
BUGS
simpleftp is an extremely poor substitute for more complete programs like the freely available wget or ncftp utilities. It was written
only to provide elementary support in INN for non-interactive fetching of the files in <ftp://ftp.isc.org/pub/pgpcontrol/> or
<ftp://ftp.isc.org/pub/usenet/CONFIG/> without requiring administrators to install yet another package. Its shortcomings as a general
purpose program are too numerous to mention, but one that stands out is that downloaded files by simpleftp override existing files with the
same name in the local directory.
HISTORY
Tossed off by David C Lawrence <tale@isc.org> for InterNetNews. Rewritten to use "Net::FTP" by Julien Elie.
$Id: simpleftp.pod 8357 2009-02-27 17:56:00Z iulius $
SEE ALSO
actsync(8).
INN 2.5.2 2009-05-21 SIMPLEFTP(1)