Questions tagged [net-ftp]

29 questions
13
votes
2 answers

Why can't Net::FTP connect to server?

I am trying to create a script to list and download data from a FTP server with Ruby. I am new to Ruby so I looked for documentation how to use Net::FTP. I have trouble understanding why this doesn't work: require 'net/ftp' server =…
adhown
  • 421
  • 3
  • 8
  • 17
6
votes
1 answer

Net::ftp getbinaryfile() saving to file vs saving to variable

Using the following ftp_download method works, but if I change ftp.getbinaryfile(file,localdir,1024) #=> Saves the file to localdir to ftp.getbinaryfile(file) #=> returns nil I get nil returned. According…
user2012677
  • 5,465
  • 6
  • 51
  • 113
6
votes
3 answers

How to use proxy server with Ruby Net::FTP?

I am using the Net::FTP ruby library to connect to an FTP server and download files. It all works well, but now I need to use an outbound proxy since their firewall whitelists IP addresses, and I am using Heroku to host the site. I'm trying out the…
Erik J
  • 828
  • 9
  • 22
5
votes
0 answers

Ruby Net/sftp gem - Establishes and creates file, but 0 byte is uploaded

I'm trying to make a script in Ruby that can uploads a local file to a ftp server using a sftp connection. The script establishes a connection to the server and creates the file just fine. The problem is that the file it not uploaded correctly. The…
4
votes
1 answer

NET::FTP ruby on rails vist parent directory?

a=Net::FTP.open('path', 'username','password') a.chdir('any name of directory') But how to visit the parent directory from a.pwd()
vidur punj
  • 5,019
  • 4
  • 46
  • 65
3
votes
3 answers

Using Net::FTP instance method `open` for FTP with custom port

I have a remote ftp server. I can connect to it with CyberDuck or terminal ftp client. When trying to connect with Net::FTP I can do this: ftp=Net::FTP.new ftp.connect('url', 'port') ftp.login('username', 'password') However, doing…
konnigun
  • 1,797
  • 2
  • 17
  • 30
3
votes
0 answers

Use Perl to FTP a file behind a HTTP proxy

I have written a simple Perl script to list, get the mtime and then get the files (based on mtime). This has been done using the Perl Net::FTP module that is available in RHEL5/6. My problem is that I now have to adapt this script to transfer files…
maloo
  • 380
  • 4
  • 12
2
votes
1 answer

how to parse XML file remotely from FTP with nokogiri gem, without downloading

require 'net/ftp' require 'nokogiri' server = "xxxxxx" user = "xxxxx" password = "xxxxx" ftp = Net::FTP.new(server, user, password) files = ftp.nlst('File*.xml') files.each do |file| ftp.getbinaryfile(file) doc = Nokogiri::XML(open(file)) …
Askar
  • 5,784
  • 10
  • 53
  • 96
1
vote
1 answer

How do I copy a file onto a separate server using Net::FTP?

I'm building a Rails app which creates a bookmarklet file for each user upon sign-up. I'd like to save that file onto a remote server, so I'm trying Ruby's Net::FTP, based on "Rails upload file to ftp server". I tried this code: require…
Bon Champion
  • 181
  • 1
  • 9
1
vote
1 answer

Ruby 1.9 + Net::FTP => Encoding::UndefinedConversionError

i upgraded from Ruby 1.8.7 to 1.9.2 (and Rails 3.2.2) and have the problem that Net::FTP#gettextfile is throwing an Encoding::UndefinedConversionError I'm trying to download a xml file which is encoded as utf-8. The dowload works fine if i use…
1
vote
2 answers

Missing error in $@ for Perl Net::FTP

After figuring out (via SO, of course) that the error for a bad $ftp = Net::FTP->new() call is in $@ while subsequent errors can be obtained by $ftp->message(), I'm striking a small problem. My code is basically: while (1) { # Wait for cycle…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
1
vote
1 answer

incomplete FTP transfer

use Net::FTP; $ftp = Net::FTP->new($host) or die "Cannot connect to $host: $@"; $ftp->binary; $ftp->login($user, $pass) or die "Cannot login: ", $ftp->message; $ftp->cwd("downloads") or die "Cannot change working directory to downloads: ",…
CJ7
  • 22,579
  • 65
  • 193
  • 321
1
vote
0 answers

A call to SSPI failed, see inner exception using FileZilla Server and System.Net.FtpClient

I am setting up an FTP Server (FileZilla) and using the netftp codeplex project System.Net.FtpClient to connect to it over SSL/TLS using an X509Certificate2. I've downloaded FileZilla Server from sourceforge. I've downloaded System.Net.FtpClient…
Loathing
  • 5,109
  • 3
  • 24
  • 35
1
vote
1 answer

Errno::EPIPE: Broken pipe with Net::FTP

Similar to this question, I can connect and even check/change the working directory, but calling list throws a Errno::EPIPE: Broken pipe error. So far I've only seen this from Terminal (OS X). I've tried a couple different hosts, which I've verified…
acobster
  • 1,637
  • 4
  • 17
  • 32
1
vote
1 answer

Images uploaded with Via Perl Net::FTP get corrupted

Why am I always getting corrupted image file when uploading to FTP server? .gif image doesn't get corrupted, only .jpeg/jpg and .png get corrupted. sub png{ my $ftp=Net::FTP->new($fhost)or die &ftpErr; $ftp->login($hostname, $hostpass); …
Muskovitz
  • 101
  • 7
1
2