Skip to content
Adds to Paperclip the ability to skip uploading a file if it's the same as the file it's replacing
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.document
.gitignore
.rspec
.ruby-gemset
.ruby-version
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
paperclip_duplicate_check.gemspec

README.md

Paperclip Duplicate Checker

Author Tim Morgan
Version 1.0 (Apr 20, 2012)
License Released under the MIT license.

This class extends Paperclip, adding a feature that forgoes uploading a replacement for an existing attachment file if the replacement is identical to the existing file.

In order for this to work, your model _must_have an <attachment>_fingerprint column, since MD5 fingerprints are used for comparison. To use, simply follow this example:

class MyModel < ActiveRecord::Base
  include CheckForDuplicateAttachedFile
  has_attachment :note
  check_for_duplicate_attached_file :note
end

Et voila! You save on bandwidth costs if your code re-uploads a lot of the same files.

Something went wrong with that request. Please try again.