Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4064764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:53:51+00:00 2026-05-20T15:53:51+00:00

Excuse me I am using paperclip. so when i attachment a file diferent to

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:53:52+00:00Added an answer on May 20, 2026 at 3:53 pm

    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_type validator that paperclip gives you:

    validates_attachment_content_type :attachment, /^image.*/, :message => "Your error message"
    

    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:

    has_attached_file :attachment, :styles => {:thumbnail => ["89x67!", :jpg]}
    before_post_process :image?
    
    def image?
      !!(attachment_content_type =~ /^image.*/)
    end
    

    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 the post_process will 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).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please excuse the funny title, I am using it in analogy with zip bomb
please excuse me for simple question: i tried to write simple csv file using
Please excuse any mistakes in terminology. In particular, I am using relational database terms.
New to MVVM so please excuse my ignorance. I THINK i'm using it right
Excuse my title if it's confusing, but I don't know how else to describe
Please excuse me as I'm pretty new to using .htaccess, and am having a
I'm using $.get to run through an XML file & return a the values
I'm using FreeWebDesigner to edit a certain website. Please excuse the clunkiness of the
Excuse me. I am using jcarousel for nice sliders. so I have got two
Excuse me if this is the wrong place to ask. I have been using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.