# How do we decide location of our photos in attachment \_fu for Windows XP?

**URL:** <https://www.ruby-forum.com/t/how-do-we-decide-location-of-our-photos-in-attachment-fu-for-windows-xp/124722>\
**Category:** Rails\
**Created:** [January 1, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/how-do-we-decide-location-of-our-photos-in-attachment-fu-for-windows-xp/124722 "2008-01-01T19:31:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 1, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/how-do-we-decide-location-of-our-photos-in-attachment-fu-for-windows-xp/124722/1 "2008-01-01T19:31:08Z")

</div>

Simply put: I don’t understand the reasoning behind where photos are  
stored in the :file\_system option of attachment\_fu?

has\_attachment :content\_type =\> :image,  
:storage =\> :file\_system,  
:max\_size =\> 2.megabytes,  
:resize\_to =\> ‘320x200\>’,  
:thumbnails =\> { :thumb =\> ‘100x100’ },  
:processor =\> ‘rmagick’

validates\_as\_attachment

def full\_filename(thumbnail = nil)  
file\_system\_path = (thumbnail ?  
thumbnail\_class :self).attachment\_options[:path\_prefix].to\_s  
File.join(RAILS\_ROOT, file\_system\_path,  
thumbnail\_name\_for(thumbnail))  
end

For some ‘magical’ reason this worked fine with my Rails 1.2.6 source  
code and now it objects. I am certain that the problem resides in  
WHERE Windows XP tries to save the photo. I know this because I  
changed the :storage value to S3 and the code went through (although  
using Windows XP the image is not viewable using this plugin do to  
some type of operating system anomoly?).  
Anyway, how do you guys declare your "full\_filename(thumbnail) path  
and what is the significance of this?

The error message I get with Windows XP is:  
{“media\_id”=\>“6”,  
“commit”=\>“Save Photo”,  
“mediaphoto”=\>{“title”=\>“Test photo”,  
“uploaded\_data”=\>#\<File:c:/temp/CGI2532-5\>,  
CGI4076-5\>,  
“geo\_long”=\>“0.0”,  
“show\_geo”=\>“1”,  
“geo\_lat”=\>“0.0”}}  
I seem to recall months ago that there was a problem as Windows mixes  
forward slashes with backward slashes??? I want the uploaded data to  
put itself in the \mediaphoto"goes here" folder.  
Thank you,  
Kathleen

removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 1, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/how-do-we-decide-location-of-our-photos-in-attachment-fu-for-windows-xp/124722/2 "2008-01-01T22:20:28Z")

</div>

it`s described by :path\_prefix param or default  
has\_attachment :storage =\> :file\_system,  
:path\_prefix =\> ‘public/pictures/avatar/blogs’,

i`m testing the proj on XP and it work fine

removed\_email\_address@domain.invalid:

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 1, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/how-do-we-decide-location-of-our-photos-in-attachment-fu-for-windows-xp/124722/3 "2008-01-01T22:23:24Z")

</div>

You can override the full\_filename method by coding it in your model.  
Copy the source from attachment\_fu.rb into your model and hack away.

f
