Displaying 1 result from an estimated 1 matches for "image_extensions".
2006 Mar 16
0
problem with file_column storing images and other files
...:magick options hash to deal
with images, file_column doesn''t accept other types of files anymore:
only images. I figured a way around this is to do something like:
class ProductFile < ActiveRecord::Base
# Accepted MIME types, mime types that are not part of this list are rejected
IMAGE_EXTENSIONS = {
"image/gif" => "gif",
"image/jpg" => "jpg",
"image/png" => "png"
}
OTHER_EXTENSIONS = {
"application/pdf" => "pdf",
"application/msword" => "doc",
"...