# Attachement\_fu , protected files and displaying images

**URL:** <https://www.ruby-forum.com/t/attachement-fu-protected-files-and-displaying-images/109478>\
**Category:** Rails\
**Created:** [July 15, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/attachement-fu-protected-files-and-displaying-images/109478 "2007-07-15T16:37:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jochen\_kaechelin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@jochen\_kaechelin](https://www.ruby-forum.com/u/jochen_kaechelin)\
**Post date:** [July 15, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/attachement-fu-protected-files-and-displaying-images/109478/1 "2007-07-15T16:37:48Z")

</div>

I use attachement\_fu to store files above the public folder  
so that I can protect them. Only authenticated users are able  
to download the files. Anything works as expected.

But I still have a problem:

If the uploaded file is a image (content\_type = image/jpeg) I want  
to display the thumbnail to the public - the big file is still only  
downloadable to authenticated users.

image\_tag (image.public\_filename) does not work because it looks  
for the filename under /public/…

Any help?

–  
Jochen K.  
[gissmoh.de](http://gissmoh.de), [figgfrosch.de](http://figgfrosch.de), [ror-ror.de](http://ror-ror.de)
