Send batch files to FTP server, got Permission denied error message

Dear all,
I wrote the following script to send some text file under one folder to
FTP server, but, while I run it, I got a error message:

C:/Ruby193/lib/ruby/1.9.1/net/ftp.rb:662:in `initialize’: Permission
denied - E:\Dev\robot\test\FTPtest (Errno::EACCES)

Any help would be great appreciated.
P.S. the script running in Windows 7, 64,

Regards
Edward.
--------------this is the script----------------------------

require ‘net/ftp’
require ‘find’

local_file=‘E:\Dev\robot\test\FTPtest’
server_path=’***’

begin
ftp = Net::FTP::new(ftp_host)
ftp.login(username, password)
ftp.chdir(server_path)
Find.find(local_file ) do |f|
ftp.puttextfile(local_file, remotefile = File.basename(f))
end
end
rescue Net::FTPError
$stderr.puts “Couldn’t connect.”
end

Figured out it:

ftp.puttextfile(local_file, remotefile = File.basename(f))

should be:

ftp.puttextfile(f , remotefile = File.basename(f))

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs