Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

How do i create a version carrierwave depending of file extention

Rails • Asked by Víctor Soto

I trying to upload files with Carrierwave in my Rails app, files could be jpg, png, pdf or docx. Files jpg and png upload fine but pdf or docx don't, i get the error "...Minimagick, maybe it is not an image?", i read many forums and they say the error could be about the Carrierwave versions.

I  need to validate in the uploader that create version only when the file is an image jpg or png.


Hey Victor,

The Carrierwave docs cover this here:

You just want to check if it's an image before running the resizing and it's pretty easy to do. 👍

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 31,353+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.