Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

RISCfuture/paperclip_duplicate_check

Repository files navigation

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.

About

Adds to Paperclip the ability to skip uploading a file if it's the same as the file it's replacing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages