Image content-type question

If I want to check that someone has uploaded a standard image, would
simply doing

class Image
def validate
errors.add(:content_type, “must be an image”) unless
content_type and content_type.include?(“image”)
end
end

So, basically checking to make sure that the content type of the image
contains “image”. Will that backfire at any point? I suppose I could
check for “image/jpeg” or “image/gif” or whatever.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs