Questions tagged [paperclip]

Paperclip is a library for the Ruby on Rails framework which makes dealing with file attachments easier. In addition to dealing with standalone files, the library provides convenience methods for creating image thumbnails. Paperclip is now deprecated - the authors recommend using ActiveStorage (they have provided a migration guide)

Paperclip is now deprecated. The library authors recommend switching to ActiveStorage. They have provided a migration guide as well.

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.

For more information:

4288 questions
15
votes
3 answers

Rails Paperclip & Multiple File Uploads

I am looking for a solution to give the user the ability to upload multiple images through one file_field. I have looked in to options such a Jquery File Upload and Uploadify but have yet to come across good examples with a working solution. I…
kcollignon
  • 155
  • 1
  • 1
  • 5
14
votes
2 answers

warning: URI.escape is obsolete when using paperclip in ruby 2.7.2

ruby - 2.7.2 rails - 6.0 paperclip - 6.1.0 I am getting following warning in my console, while using paperclip gem with ruby 2.7.2 /Users/***/.rvm/gems/ruby-2.7.2/gems/paperclip-6.1.0/lib/paperclip/url_generator.rb:68: warning:…
honey
  • 981
  • 6
  • 19
14
votes
1 answer

Rails - Paperclip - How to Check the Image Dimensions before saving

I have a Rails 3 app with paperclip. I want to prevent images with a width/height of LTE 50x50 from being saved by paperclip. Is this possible?
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
14
votes
2 answers

Rails 4 + Paperclip + S3: Changing endpoint to access an S3 bucket in User model?

Should be a pretty simple fix to this question, I think, but I can't seem to get it to work. I have a Rails 4 app, a User model with a photograph attribute setup with Paperclip, and I have it linked to S3. Here's the User model: has_attached_file…
r123454321
  • 3,323
  • 11
  • 44
  • 63
14
votes
1 answer

Heading into 2013, should I go with Dragonfly or Paperclip or Carrierwave?

I am just another average joe hoping to jump onto the social network bandwagon. I'd like to know which photo uploading/resizing gem I should use for users of my app. It would be great if you could explain why.
pratski
  • 1,448
  • 2
  • 22
  • 37
14
votes
1 answer

Paperclip: upload from url with extension

I would like to upload pictures from URLs by paperclip on S3 storage. I work with : Ruby 1.9.3 Rails 3.2.6 paperclip 3.1.3 aws-sdk 1.3.9 I have my Picture Model: class Asset has_attached_file :asset, :styles => {:thumb => "60x60>"}, …
CupraR_On_Rails
  • 2,449
  • 1
  • 19
  • 24
14
votes
6 answers

Ruby open-uri open method loses file extension opening images

I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5. My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an…
Jimmy
  • 9,686
  • 14
  • 59
  • 78
14
votes
3 answers

Paperclip change images path after upgrade to rails 3.2

i have a problem with paperclip (3.0.2) after upgrade to rails 3.2 (from 3.0.10). Originally the path of one image was: "http://localhost:3000/system/photos/94/small/AudiLogo.jpg?1335392139" and after the upgrade this kind of images never show…
jgiunta
  • 721
  • 2
  • 8
  • 28
14
votes
3 answers

Errors::SignatureDoesNotMatch, AWS-SDK gem for S3 support on paperclip 3.0.1 and rails 3.2

I'm migrating my app from Rails 3.0.9 to 3.2.3 and ruby 1.9.3. I was using paperclip(2.3.11) with aws-s3 gem to store my pictures. Now I want to use the last version of paperclip(3.0.1) and then I have to use aws-sdk gem. I've set my aws.yml file…
Bachet
  • 321
  • 1
  • 2
  • 14
13
votes
1 answer

Paperclip/Rspec tests: Is there a faster way to test paperclip validates_attachment_content_type?

One thing I've noticed is that in most of the projects I do, the one spec that always takes a long time (30 seconds +) is this shoulda/paperclip helper: it { should validate_attachment_content_type(:bannerimage) .allowing('image/png',…
PlankTon
  • 12,443
  • 16
  • 84
  • 153
13
votes
2 answers

Does Paperclip automatically clean up filenames?

I'm using Thoughtbot's Paperclip gem to handle file uploads. I'm finding that when I upload a file with spaces in the filename, it gets stored with the spaces replaced with underscores. That's good. I also tried uploading a file with special…
Ethan
  • 57,819
  • 63
  • 187
  • 237
13
votes
4 answers

Getting GPS metadata from a picture with Paperclip

I have a question about Paperclip. Many modern cameras and phones add GPS metadata to a photo when taken: Users of my Rails app can upload photos and manually add the location data to them. However, this sucks as users don't want to enter that:…
user142019
13
votes
8 answers

Stubbing Paperclip S3 requests in specs

I am using Paperclip and S3 for image uploads and am trying to stub out calls to S3 from my test suite. I found the thoughtbot post which mentions doing a.cover { a.paperclip_fixture('album', 'cover', 'png') } but that gives me a "wrong…
Eric M.
  • 5,399
  • 6
  • 41
  • 67
13
votes
2 answers

How can I restrict Paperclip to only accept images?

How can I restrict Paperclip to only accept images? I'm using Amazon S3 for storage if that's relevant. Thanks for reading.
ben
  • 29,229
  • 42
  • 124
  • 179
13
votes
2 answers

ImageMagick installation in Docker Alpine

So I have this Dockerfile that attempts to install ImageMagick the following way: FROM ruby:2.4-alpine ... RUN apk --update add imagemagick ... The point is that the container doesn't recognizes the file utility (for content-type…
Fdo
  • 1,053
  • 4
  • 15
  • 38