Commit 9b3c51d7 by Jon Yurek

Updated validates_attachment_content_type doc to warn of IE tomfoolery.

parent d08eeb32
...@@ -180,7 +180,11 @@ module Paperclip ...@@ -180,7 +180,11 @@ module Paperclip
# Places ActiveRecord-style validations on the content type of the file assigned. The # Places ActiveRecord-style validations on the content type of the file assigned. The
# possible options are: # possible options are:
# * +content_type+: Allowed content types. Can be a single content type or an array. Allows all by default. # * +content_type+: Allowed content types. Can be a single content type or an array.
# Each type can be a String or a Regexp. It should be noted that Internet Explorer uploads
# files with content_types that you may not expect. For example, JPEG images are given
# image/pjpeg and PNGs are image/x-png, so keep that in mind when determining how you match.
# Allows all by default.
# * +message+: The message to display when the uploaded file has an invalid content type. # * +message+: The message to display when the uploaded file has an invalid content type.
def validates_attachment_content_type name, options = {} def validates_attachment_content_type name, options = {}
attachment_definitions[name][:validations] << lambda do |attachment, instance| attachment_definitions[name][:validations] << lambda do |attachment, instance|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment