# Content-type method missing for Tempfile

**URL:** <https://www.ruby-forum.com/t/content-type-method-missing-for-tempfile/149789>\
**Category:** Rails\
**Created:** [September 29, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/content-type-method-missing-for-tempfile/149789 "2008-09-29T21:30:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iain\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6bbea6/32.png) [@Iain\_A](https://www.ruby-forum.com/u/Iain_A)\
**Post date:** [September 29, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/content-type-method-missing-for-tempfile/149789/1 "2008-09-29T21:30:12Z")

</div>

Hello,

I have created a group model that has a picture. On uploading the  
picture the variable uploaded\_file is set as the Tempfile uploaded. I  
then have an after\_save method that creates several thumbnails of this  
picture using RMagick. The trouble I am having is when I try and copy  
a group with some pictures. I would like to be able to make another  
Tempfile which was the original picture file and set it to the  
variable uploaded\_file. Then when save is called on this copied or  
“cloned” group it too will save thumbnails of the main picture.

The trouble is that when I create the Tempfile that is the same as the  
original file. For some reason the method ‘content-type’ which is  
available after an upload is missing. Also, I can’t seem to find the  
method anywhere in the Rdoc for a Tempfile.

Can someone help me please? Any ideas?

Thanks

Iain
