Excuse me I am using paperclip. so when i attachment a file diferent to image (when i don´t upload jpeg,gif or png example zip) show this error:
* Photo C:/Users/MAXIMI~1/AppData/Local/Temp/stream4556-0.rar is not recognized by the 'identify' command.
* Photo C:/Users/MAXIMI~1/AppData/Local/Temp/stream4556-0.rar is not recognized by the 'identify' command.
* Photo C:/Users/MAXIMI~1/AppData/Local/Temp/stream4556-0.rar is not recognized by the 'identify' command.
which is the locale tree path for this error? or which are the locale tree path for paperclip error.
NOTE: I am talking about i18n locale (translate)
thanks in advance
I don’t know about the i18n translation path for this, but if you don’t want users to upload non-image file types you should use the
validates_attachment_content_typevalidator that paperclip gives you:Which will generate a sane error for the user instead of the cryptic ImageMagick one. Alternatively, if you want users to be able to upload any file type, but style images a certain way, you can fix your problem like this:
This will make it so that all images that get uploaded will also generate an 89×67 sized thumbnail, but if it’s not an image type it will skip the processing because
image?will return false, and thepost_processwill not execute (but the file will still be uploaded).This adds the benefit of being able to say
asset.image?later on in a view or something and deciding whether to render it within an image_tag, or as a direct link (just for example).