# Error while assigning the content type

**URL:** <https://www.ruby-forum.com/t/error-while-assigning-the-content-type/148633>\
**Category:** Rails\
**Created:** [September 15, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/error-while-assigning-the-content-type/148633 "2008-09-15T19:32:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rockey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a698b9/32.png) [@Rockey](https://www.ruby-forum.com/u/Rockey)\
**Post date:** [September 15, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/error-while-assigning-the-content-type/148633/1 "2008-09-15T19:32:04Z")

</div>

if request.post?  
@fData = params[:photo]  
puts("\n\n"removed\_email\_address@domain.invalid\_type+"\n\n\n") # Here I am getting  
the right content type  
@fData.content\_type = File.mime\_type?  
(params[:photo].original\_filename)  
# In the above statement, I am getting the error while  
reassigning the datatype. I am alrady using multipart in form  
# undefined method `content\_type=’ for #\<File:C:/Users/dell/  
AppData/Local/Temp/CGI55192-1\>  
# {“photo”=\>#\<File:C:/Users/dell/AppData/Local/Temp/CGI55192-1\>,  
“picture”=\>{“id”=\>“0”}}  
end
