#8 ✓resolved
jaredbrown (at gmail)

Documents Not Converting Properly in Scribd

Reported by jaredbrown (at gmail) | June 26th, 2010 @ 03:38 PM

Paperclip storing to S3 [Current gem versions] (Tested and working)
scribd_fu 2.0.6
scribd-rscribd 1.0.3

Doc stored in S3 @ http://s3.amazonaws.com/talentopoly-resumes/documents/21/about-bloc...

Issue: Document appears in Scribd with 0 pages and the following message:

"Oh, no! Your upload has failed. Our software was unable to determine the file type.

Please try uploading the same document in PDF format. This is the format our conversion system is most comfortable with."

Uploading Doc From Local Storage: Works
Uploading Doc Directly on Scribd.com: Works

Permissions for file in S3: Open/Download for Everyone (Being set by default)

I can download the file via URL and view it locally fine.

Any ideas?

Comments and changes to this ticket

  • jaredbrown (at gmail)

    jaredbrown (at gmail) June 26th, 2010 @ 03:39 PM

    require 'paperclip'

    class Resume < ActiveRecord::Base
    belongs_to :user belongs_to :city has_many :top_resume_locations has_many :top_resume_referrers has_one :total_resume_view has_one :total_introduction has_many :daily_resume_views has_many :resume_views belongs_to :category

    has_attached_file :document,

                    :storage => :s3,
                    :s3_credentials => "#{RAILS_ROOT}/config/amazon_s3.yml",
                    :path => ":attachment/:id/:filename",
                    :bucket => 'talentopoly-resumes'

    #validates_attachment_presence :video #validates_attachment_content_type :data, :content_type => 'image/jpeg', :message => "has to be in jpeg format" has_ipaper_and_uses 'Paperclip'

    validates_length_of :vanity, :within => 4..40 validates_format_of :vanity, :with => /^[a-z0-9]*$/i validates_uniqueness_of :vanity, :case_sensitive => false, :allow_nil => false, :allow_blank => false validates_presence_of :location validates_presence_of :summary validates_presence_of :experience validates_presence_of :education validates_length_of :location, :within => 0..255 validates_presence_of :city_id validates_presence_of :category_id validates_presence_of :titles end

  • jaredbrown (at gmail)

    jaredbrown (at gmail) June 26th, 2010 @ 03:50 PM

    It appears the issue is the cache-busting ?1277580374 at the end.

    The following line in paperclip.rb needs to strip the ?1277580374 off if attached_file.url is used.

    attached_file.url =~ ScribdFu::S3 ? attached_file.url : attached_file.path

  • jaredbrown (at gmail)

    jaredbrown (at gmail) June 26th, 2010 @ 04:50 PM

    Returns the full filename for the given attribute. If the file is

    stored on S3, this is a full S3 URI, while it is a full path to the

    local file if the file is stored locally.

    def file_path
    if attached_file.url =~ ScribdFu::S3

    pos = attached_file.url.rindex('?')
    pos > 0 ? attached_file.url[0, pos] : attached_file.url



    end end

  • Matt Darby

    Matt Darby June 28th, 2010 @ 11:03 AM

    • State changed from “new” to “open”

    Odd. What version of Rails are you using? I've never noticed the "cache string" being appended to S3 URLs before?

  • jaredbrown (at gmail)

    jaredbrown (at gmail) June 28th, 2010 @ 11:25 PM

    rails 2.3.5
    thoughtbot-paperclip 2.3.1

  • Matt Darby

    Matt Darby June 30th, 2010 @ 10:09 AM

    • State changed from “open” to “resolved”

    Just pushed 2.0.7 with the fix. Good eye :)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A Ruby on Rails plugin that streamlines interaction with Scribd.com’s iPaper service, and works along side of either Attachment_fu or Paperclip.

People watching this ticket