> image modelclass Image < ActiveRecord::Base has_attachment end> mailman controllerclass Mailman < ActionMailer::Base def receive(email) email.attachments.each do |attachment| Image.create :uploaded_data => attachment end end end> I got returned email with error messagesCommand died with status 1: "/usr/local/bin/ruby /home/email_test/script/runner ''Mailman.receive(STDIN.read)''". Command output: /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/runner.rb:47: /usr/local/lib/ruby/1.8/tempfile.rb:46:in `initialize'': cannot generate tempfile `/home/email_test/script/../config/../tmp/attachment_fu/11862540901020801593_f62fd725ce18176-9.jpg'' (RuntimeError) from /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:170:in `new'' from /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:170:in `write_to_temp_file'' from /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:304:in `write_to_temp_file'' from /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:294:in `temp_data=3D'' from /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:259:in `uploaded_data=3D'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in `send'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in `attributes=3D'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1671:in `each'' ... 11 levels... from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/runner.rb:47 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /home/email_test/script/runner:3 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/25/07, Sean Kim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > image model > > class Image < ActiveRecord::Base > has_attachment > end > > > mailman controller > > class Mailman < ActionMailer::Base > def receive(email) > email.attachments.each do |attachment| > Image.create :uploaded_data => attachment > end > end > endYou''re not uploading data, so it''s not really appropriate to use that method. You''ll have to set the fields manually then (filename, content type, etc). A future update to the plugin will be able to guess the content type for you based on the file. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---