I use the Paperclip gem for Rails so that users can upload the photo on their own. I obviously only want to accept jpeg , gif or png images. What is the correct way to check for these files, was downloaded instead of something else, such as a Word document?
According to the paperwork documents, I check the type of content with:
validates_attachment :document, content_type: "application/pdf"
What is the correct way to verify the above various image formats ( gif , png , jpeg )?
at.
source share