Hello, I have setup ActionMailer to send mail with attachments, but when I try to send an email with an attachment that attachment_fu has uploaded ActionMailer can''t find the files, it seems to be looking in the wrong directory... The mailer setup is: attachment :body => File.read(document.public_filename) now this is able to find all the right stuff, /documents/000/001/file.txt but it looks in the very base directory, in my C drive, not in my public folder on my project. Please help, Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- No virus found in this outgoing message. Checked by AVG. Version: 8.0.100 / Virus Database: 269.24.4/1475 - Release Date: 5/30/2008 2:53 PM
Andrew, On Sat, May 31, 2008 at 3:37 AM, Andrew Doades <ard-UVRRe/+0hzLQXOPxS62xeg@public.gmane.org> wrote:> The mailer setup is: > attachment :body => File.read(document.public_filename) >Use full_filename instead of public_filename Brandon -------------------------------------------------------------------------------- Sessions by Collective Idea: Ruby on Rails training in a vacation setting http://sessions.collectiveidea.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 -~----------~----~----~----~------~----~------~--~---
Brandon Keepers wrote:> Andrew, > > On Sat, May 31, 2008 at 3:37 AM, Andrew Doades <ard-UVRRe/+0hzLQXOPxS62xeg@public.gmane.org > <mailto:ard-UVRRe/+0hzLQXOPxS62xeg@public.gmane.org>> wrote: > > The mailer setup is: > attachment :body => File.read(document.public_filename) > > > Use full_filename instead of public_filename > > Brandon >Cheers Brandon, That did the trick. Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- No virus found in this outgoing message. Checked by AVG. Version: 8.0.100 / Virus Database: 269.24.4/1475 - Release Date: 5/30/2008 2:53 PM