I have been using attachment_fu for a while now with jpg, gif, png
without any trouble. I recently tried to upload a bmp and got:
"Content type is not included in the list"
So, I added the following to the @@content_types in attachment_fu:
Closer inspection of the content_type of the file was coming through
I am using RMagick as the image processor.
Has anyone else run into this problem with bmp and attachment_fu? Is
there another content_type that will resolve this? I tried adding
'application/octet-stream' to my content types but this didn't work
nor feel right.
application/octet-stream is just a generic file stream, i.e. without a known mime type. You could patch attachment_fu (the code of the plugin is so nice and neat you’ll have no problem finding the right place) to use the .bmp extension to determine the file type (or use the similar directions at http://blog.airbladesoftware.com/2007/8/8/uploading-files-with-swfupload).
Peter De Berdt
Thanks for pointing me the right direction Peter.
Seems that all I needed to do was augment the uplaoded_data= method
if file_data.content_type == 'application/octet-stream' &&
File.extname(uploaded_data.original_filename) == ".bmp" then
self.content_type = 'image/bmp'
self.content_type = file_data.content_type
That seems to have done the trick.
I hope I'm not fragmenting your thread here but do any of you guys
know how to get attachment_fu to send a 'healthy' image file up to S3?
I've followed this in detail my Windows XP development box, only a
ZERO k file is being uploaded to S3 for any type of file from .png
to .gif to .jpg.
Obviously, I will run my application eventually on a Linux server but
it sure would be nice to see my photos in development.