Programmatically ftp from rails app

I would like to create the functionality to ftp a file from my rails
CMS system, does anyone have some insight on FTP functionality/code?

On 8/02/2008, at 6:23 AM, agilehack wrote:

I would like to create the functionality to ftp a file from my rails
CMS system, does anyone have some insight on FTP functionality/code?

Here we go:

require ‘net/ftp’

ftp = Net::FTP.new(‘example.com’)
ftp.login(user = “", passwd = "”)
ftp.putbinaryfile(“/data/images/myimage.jpg”, File.basename( “/data/
images/myimage.jpg” ))
ftp.quit()

On 8/02/2008, at 6:23 AM, agilehack wrote:

I would like to create the functionality to ftp a file from my rails
CMS system, does anyone have some insight on FTP functionality/code?

Also you would obviously want to through a rescue in there for ftp
errors

thank you bud