FTP problems on windows

C

csjasnoch

I created a script to send a receive event scripts for a pixord video
server.
I created an FTP session class which contains the following def's

def initialize(ip)
begin
@serv = Net::FTP.new(ip)

@serv.login(user=*****,password =*****)
#get into Sys dir
@serv.chdir('Sys')

rescue
puts "Invalid IP set. ip set as #{ip}\n"
end
end

def get_curr(filename)



loadfile = @serv.gettextfile("scr00.txt")#get the event file
stored
#in the pixord server

# change the name of the file to given file name
File.rename("scr00.txt", filename)


end

def put_curr(filename)

#change name to pixord event name

begin
File.rename(filename, "scr00.txt")

rescue

puts "file name problem #{filename}\n"

end
@serv.puttextfile("scr00.txt")
end

#####################

Everything works fine with my other implimentations (on OSX). However,
when on a windows machine I can not view anything in the server. The
connection is being made though.

To test what was going on I used irb on Windows (I have tried XP and
2000) and entered the following

require 'net/ftp'
ftp = Net::FTP.new(ip)
ftp.login(user=user_var,password=pass_var)

#UP TO HERE OK (I think.. no errror or anything)
ftp.chdir('Sys')

ftp.gettextfile("scr00.txt") #here is where problem occurs

###########END CODE

When I run from a Mac OSX machine I can access fine, but from the
windows machines I am getting "Net:FTPTempError 425 Can't Open Data
Connection"
I am not exactly sure how to deal with this. If they are on different
subnets how do I handle this. I am pretty sure the Mac is also but for
some reason is handling it OK. I am a bit baffled. Any help is
appreciated. Thanks in advance.

-Collin
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: FTP problems on windows"
on Tue, 19 Jul 2005 06:55:56 +0900, (e-mail address removed) writes:

|I created a script to send a receive event scripts for a pixord video
|server.
|I created an FTP session class which contains the following def's

You might need to use passive mode. Try adding

@serv.passive = true

in your code.

matz.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top