# Re: attachment\_fu :uploaded\_data

**URL:** <https://www.ruby-forum.com/t/re-attachment-fu-uploaded-data/132395>\
**Category:** Rails\
**Created:** [March 19, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/re-attachment-fu-uploaded-data/132395 "2008-03-19T18:04:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [March 19, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/re-attachment-fu-uploaded-data/132395/1 "2008-03-19T18:04:18Z")

</div>

I was having an issue with uploading issues Windows but you might want  
to check out

> **[Emmanuel's Blog](http://epirsch.blogspot.com/2008/01/fixing-attachmentfu-on-windows-like.html)**
>
> Fixing attachment\_fu on Windows Like many others , I've encountered issue when developing Rails applicat...

----- Original Message ----  
From: Michael … [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Sent: Wednesday, March 19, 2008 10:18:31 AM  
Subject: [Rails] attachment\_fu :uploaded\_data

Hi.  
In my Model DesignThumbnail I use Attachment\_fu.

## ----------------- Model ------------------------------- class DesignThumbnail \< ActiveRecord::Base has\_attachment :content\_type =\> :image, :storage =\> :file\_system, :max\_size =\> 150.kilobytes, :resize\_to =\> ‘86x170\>’ validates\_as\_attachment … end

Instead of uploading the image with a form I want to use a stored image.

----------------- Controller -----------  
@thumb = DesignThumbnail.new  
@thumb.uploaded\_data =  
File.open(“#{RAILS\_ROOT}/public/images/sample.jpg”)

## if @thumb.save flash[:notice] = ‘Image was successfully created.’ redirect\_to … else render … end

I receive the error message  
“undefined method `size’ for #\<File:0x2aaaacf79118\>”

vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:288:in  
`uploaded\_data=’  
…

## thanks Michael

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [March 20, 2008, 2:24am UTC](https://www.ruby-forum.com/t/re-attachment-fu-uploaded-data/132395/2 "2008-03-20T02:24:34Z")

</div>

Mark,

I had the same issue with ‘Size’ and I tried the patch from the url  
that you posted. It works fine. But if i try to upload a file  
with .JPG (note the uppercase extension), i still get an error  
“Content type is not included in the list”. I tried including the  
extension in the plugin but still did not work.

Is there any work around to fix this.

Thanks
