Hey everybody,

scenario: frontend-server gets files from a form.file_field and should
send the filedata to a backend-server via (Hyper)ActiveResource!


I used the following code to access a method in a backend-server and
send the filedata:

CampaignTopic.post(:icon_attachments_rebuild_and_save, :filedata =>
params[:campaign_topic][:icon_brand].read, :content_type => params
[:campaign_topic][:icon_brand].content_typ )


This works fine for files less than ~10KB, otherwise a get a
Errno::ECONNRESET
An existing connection was forcibly closed by the remote host.

Application Trace:
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write0'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/protocol.rb:151:in `write'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/protocol.rb:166:in `writing'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/protocol.rb:150:in `write'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1583:in
`write_header'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1548:in
`send_request_with_body'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1534:in `exec'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1057:in `request'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1046:in `request'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:547:in `start'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:1044:in `request'
D:/dev/rubyonrails/ruby/lib/ruby/1.8/net/http.rb:854:in `post'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activeresource-2.3.2/
lib/active_resource/connection.rb:149:in `send'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activeresource-2.3.2/
lib/active_resource/connection.rb:149:in `request'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/benchmark.rb:17:in `ms'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/benchmark.rb:10:in `realtime'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/benchmark.rb:17:in `ms'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activeresource-2.3.2/
lib/active_resource/connection.rb:149:in `request'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activeresource-2.3.2/
lib/active_resource/connection.rb:134:in `post'
D:/dev/rubyonrails/ruby/lib/ruby/gems/1.8/gems/activeresource-2.3.2/
lib/active_resource/custom_methods.rb:61:in `post'
D:/.../.../../.../.../../internal/trunk/app/controllers/
campaign_topics_controller.rb:92:in `create'


The Point is, that the request doesn't contact the backend-method, so
it's the code posted above which causes the connection to be closed.
Has anyone any idea what the problem might be?

thanks for help ...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to