ruby - Net::FTP and open-uri hanging while trying to put binary file to from URL to FTP server -


I have a scenario where I have an S3 URL that contains binary content that needs to be transferred to an FTP server is. I am using net :: FTP , open-yurry and Ruby 2.0.0-p353.

  requires net / ftp 'Required' Open-Yuri 'net :: FTP.open (x, y, z) do | Ftp | Ftp.putbinaryfile (open (an_s3_url), 'remote_filename', 4096)   

The code above is a temporary open-uriXXYY - * temp file is created Dyer, but then hanged. I have no idea why. Interrupting the function causes the following trace to occur:

  home / ubuntu / .rvm / rubies / ruby-2.0.0-p353 / lib / ruby ​​/ 2.0.0 / net / Ftp.rb: 434: 'Accept' in: /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/ftp.rb:434:In / home / 'Transfer' Ubuntu /. R.V.M. / Ruby / Ruby 2.0.0-P353 / Lib / Ruby / 2.0.0 / Net / FTP RB: 543: in Stobarini / Home / Buntu /. Rubies / ruby-2.0.0-p353 / lib / ruby ​​/ 2.0.0 / net / ftp.rb: 199: /home/ubuntu/.rvm/rubies/ruby-by_bb/ From 2.0.0-p353 / lib in `with_binary '/ruby/2.0.0/net/ftp.rbitter42:en/home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0. 0 'block in the strawberry' from monitor. RB: 211: /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/ftp.rbitter41:IN From 'Stobbinari' / home to `mon_synchronize '/ ubuntu /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/ftp.rb:690:in `putbinaryfile '  

The action is to file To get it again and then put it, but it seems friction. Is there any reason why I can not do it like this, or am I making something clear? Without problems or without similar problems The answer was to use Passive FTP - it was obvious (?!) I was missing.

It is set to false by default.

  net :: FTP.open (x, y, z) {| ftp | Ftp.passive = true ...}   

worked like a charm.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -