# Attachment\_fu uploaded file with Action mailer

**URL:** <https://www.ruby-forum.com/t/attachment-fu-uploaded-file-with-action-mailer/139143>\
**Category:** Rails\
**Created:** [May 31, 2008, 12:38pm UTC](https://www.ruby-forum.com/t/attachment-fu-uploaded-file-with-action-mailer/139143 "2008-05-31T12:38:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewdon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@andrewdon](https://www.ruby-forum.com/u/andrewdon)\
**Post date:** [May 31, 2008, 12:38pm UTC](https://www.ruby-forum.com/t/attachment-fu-uploaded-file-with-action-mailer/139143/1 "2008-05-31T12:38:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrewdon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@andrewdon](https://www.ruby-forum.com/u/andrewdon)\
**Post date:** [May 31, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/attachment-fu-uploaded-file-with-action-mailer/139143/2 "2008-05-31T15:48:50Z")

</div>

Andrew,

On Sat, May 31, 2008 at 3:37 AM, Andrew D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://sessions.collectiveidea.com)

---

<div class="post-metadata">

**Author:** ![andrewdon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@andrewdon](https://www.ruby-forum.com/u/andrewdon)\
**Post date:** [May 31, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/attachment-fu-uploaded-file-with-action-mailer/139143/3 "2008-05-31T15:55:18Z")

</div>

Brandon K. wrote:

> Brandon

Cheers Brandon,  
That did the trick.

Andrew
