thoughtbot /paperclip

Easy file attachment management for ActiveRecord

★ 9,012⑂ 2,399👁 1⑃ 855● 1,847▤ 13
RubyNOASSERTIONCreated 2008-04-10thoughtbot.com
More from this author
Download: Version 6.1.0Version-6.1.0 ↓6.1.02018-07-27
+0
Daily
9,012
stars
2,399
forks
1
watchers
855
prs
1,847
issues
13
releases

README

Paperclip
=========

 Deprecated

[Paperclip is deprecated].

For new projects, we recommend Rails' own [ActiveStorage].

For existing projects, please consult and contribute to the migration guide,
available [in English], [en español], and as [a video] recorded at RailsConf
2019. You may also prefer [an alternative migration tutorial used by
Doorkeeper][].

Alternatively, for existing projects, [Kreeti] is maintaining [kt-paperclip],
an ongoing [fork of Paperclip].

We will leave the Issues open as a discussion forum _only_. We do _not_
guarantee a response from us in the Issues. All bug reports should go to
kt-paperclip.

We are no longer accepting pull requests _except_ pull requests against the
migration guide. All other pull requests will be closed without merging.

[Paperclip is deprecated]: https://robots.thoughtbot.com/closing-the-trombone
[ActiveStorage]: http://guides.rubyonrails.org/active_storage_overview.html
[in English]: https://github.com/thoughtbot/paperclip/blob/master/MIGRATING.md
[en español]: https://github.com/thoughtbot/paperclip/blob/master/MIGRATING-ES.md
[a video]: https://www.youtube.com/watch?v=tZ_WNUytO9o
[Kreeti]: https://www.kreeti.com/
[kt-paperclip]: https://rubygems.org/gems/kt-paperclip
[fork of Paperclip]: https://github.com/kreeti/kt-paperclip
[an alternative migration tutorial used by Doorkeeper]: https://www.tokyodev.com/2021/03/23/paperclip-activestorage/

 Existing documentation

 Documentation valid for master branch

Please check the documentation for the paperclip version you are using:
https://github.com/thoughtbot/paperclip/releases

---










- Requirements
  - Ruby and Rails
  - Image Processor
  - file
- Installation
- Quick Start
  - Models
  - Migrations
  - Edit and New Views
  - Edit and New Views with Simple Form
  - Controller
  - View Helpers
  - Checking a File Exists
  - Deleting an Attachment
- Usage
- Validations
- Internationalization (I18n)
- Security Validations
- Defaults
- Migrations
  - Add Attachment Column To A Table
  - Schema Definition
  - Vintage Syntax
- Storage
  - Understanding Storage
- IO Adapters
- Post Processing
- Custom Attachment Processors
- Events
- URI Obfuscation
- Checksum / Fingerprint
- File Preservation for Soft-Delete
- Dynamic Configuration
  - Dynamic Styles:
  - Dynamic Processors:
- Logging
- Deployment
  - Attachment Styles
- Testing
- Contributing
- License
- About thoughtbot



Paperclip is intended as an easy file attachment library for ActiveRecord. The
intent behind it was to keep setup as easy as possible and to treat files as
much like other attributes as possible. This means they aren't saved to their
final locations on disk, nor are they deleted if set to nil, until
ActiveRecord::Basesave is called. It manages validations based on size and
presence, if required. It can transform its assigned image into thumbnails if
needed, and the prerequisites are as simple as installing ImageMagick (which,
for most modern Unix-based systems, is as easy 

Top issues

Latest release

Version 6.1.0 v6.1.0 2018-07-27
BUGFIX: Don't double-encode URLs (Roderick Monje).
 BUGFIX: Only use the content_type when it exists (Jean-Philippe Doyle).
 STABILITY: Better handling of the content-disposition header. Now supports file name that is either enclosed or not in double quotes and is case insensitive as per RC6266 grammar (Hasan Kumar, Yves Riel).
 STABILITY: Change database column type of attachment file size from unsigned 4-byte integer to unsigned 8-byte bigint. The former type limits attachment size to just over 2GB, which can easily be exceeded by a large video file (Laurent Arnoud, Alen Zamanyan).
 STAB

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON