# Attachment\_fu and public\_filename

**URL:** <https://www.ruby-forum.com/t/attachment-fu-and-public-filename/131976>\
**Category:** Rails\
**Created:** [March 14, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-public-filename/131976 "2008-03-14T20:31:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 14, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-public-filename/131976/1 "2008-03-14T20:31:21Z")

</div>

Hey all , I’ve been using attachment\_fu for a while now and I love it,  
but recently I’ve been expanding and I have a setup on 2 servers, the  
first one is the application server and the second is the picture  
host. So I just setup my public/pictures directory as a NFS to my  
second server so uploaded pictures get saved to the second server. The  
trouble I have is the public\_filename method reads from [domain.com/](http://domain.com/)  
pictures/ and I need it to read from [pics.domain.com/pictures/](http://pics.domain.com/pictures/). I have  
all the DNS routing setup already but whenever I try to modify the  
public\_filename method it always prefixes with [domain.com/](http://domain.com/) and I just  
can’t figure out how to override the whole domain it reads from. Any  
help you could provide me would be greatly appreciated. Thanks in  
advance.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 14, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-public-filename/131976/2 "2008-03-14T20:57:52Z")

</div>

Okay i fixed it, can’t believe it took me this long to figure out.  
When i altered public\_filename i only didn’t prefix it with http:// i  
only did [pics.domain.com](http://pics.domain.com). sticking the http:// in there works just  
like I need.
