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 6711907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:11:48+00:00 2026-05-26T08:11:48+00:00

I am using paperclip for storing files related to the model. The files can

  • 0

I am using paperclip for storing files related to the model. The files can be in various formats depending on the description. I have specified following in the model:

require 'paperclip'

class Document < ActiveRecord::Base
  belongs_to :candidate
  attr_accessible :candidate_id, :description, :media

  has_attached_file :media, :styles => { :profile => "100x100>" }

  validates_attachment_presence :media
  validates_attachment_size :media, :less_than => 3.megabytes
end

Before sometime it was working fine. Recently after I had some system upgrades of archlinux (may be Imagemagick was upgraded), I have following error while saving certain formats e.g. .doc .xls etc, it works for images though.

* Media /tmp/stream20111020-2130-zeux3k-0.doc is not recognized by the 'identify' command.

When I run identify command with the file I get following.

$ identify  /tmp/stream20111020-2130-zeux3k-0.doc 
identify: no decode delegate for this image format `/tmp/stream20111020-2130-zeux3k-0.doc' @ error/constitute.c/ReadImage/532

Should Paperclip try to resize the word document at all ?

Anything, I can do about this ?

  • 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-26T08:11:49+00:00Added an answer on May 26, 2026 at 8:11 am

    I still don’t know why it was working before and now doesn’t wok, but I found out a workaround by supplying conditional style options to paperclip. Like following …

    has_attached_file :media, :styles => lambda { |attachment| (attachment.instance.description == "Foto") ? { :profile => "100x100>" }  : [] }
    

    I still want to be more specific and specify style based on the content type

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

Sidebar

Related Questions

I have a problem when using paperclip. I can see the files uploaded but
I'm trying to add photos to my app using paperclip. A mug can have
I have a model that is using Paperclip to manage the file. After I
I have a model, Thing, that has a has_many with ThingPhoto, using Paperclip to
I am using paperclip to upload files to s3 storage. Once the file is
I'm using Paperclip and have a default_url option like this for one of my
I have a RESTful resource in my Rails app called Photo. I'm using Paperclip
What I have is a Theme model, which contains many Assets. Assets are using
I need to upload files and then parse them using paperclip? Currently it is
I am getting the following error when trying to upload an image using paperclip

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.