# Attachment\_fu and mime type issues

**URL:** <https://www.ruby-forum.com/t/attachment-fu-and-mime-type-issues/135804>\
**Category:** Rails\
**Created:** [April 25, 2008, 4:19am UTC](https://www.ruby-forum.com/t/attachment-fu-and-mime-type-issues/135804 "2008-04-25T04:19:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_OSHara](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@Sean\_OSHara](https://www.ruby-forum.com/u/Sean_OSHara)\
**Post date:** [April 25, 2008, 4:19am UTC](https://www.ruby-forum.com/t/attachment-fu-and-mime-type-issues/135804/1 "2008-04-25T04:19:31Z")

</div>

## Hi All, I am having a problem with the attachment\_fu plugin and flac audio files. In the dev environment, using mongrel, the form upload object does not seem to have any associated content\_type. I get the following attachment\_fu validation error: “Content type can’t be blank”. I don’t understand why the file\_data would not have any content\_type. Doesn’t rails set the content type based on the mime type? How is it that a file can be uploaded without any mime type at all? Shouldn’t it at least have application/octet-stream if the server can’t parse the actual file type? I tried starting mongrel with: mongrel\_rails start -m config/mime\_types.yml and my mime\_types.yml file reads:

.flac: audio/flac

But this hasn’t helped. Are these configuration loaded mime types only  
used  
for serving files, and not for associating a content type with uploaded  
form  
data?

Thanks in advance for any tips.

Sean

---

<div class="post-metadata">

**Author:** ![Sean\_OSHara](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@Sean\_OSHara](https://www.ruby-forum.com/u/Sean_OSHara)\
**Post date:** [April 25, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-mime-type-issues/135804/2 "2008-04-25T14:58:54Z")

</div>

I looked into this further, and discovered that with Fireforx uploading  
of  
flac files works: the content\_type is set to ‘application/octet-stream’.  
So,  
the problem must be related to safari’s handling of mime types for  
binary  
files. I’ll have to look into that.  
thanks,  
sean
