paperclip

Rails: How to retrieve URL of Paperclip uploads?

I am having trouble retrieving the URL of images uploaded via Paperclip. I set the URL using the following code in my model: has_attached_file :banner, :path => "/www/banners/:foo-:id.:extension", :url => "http://example.com/:foo-:id.:extension" In my views, I can retrieve the URL just fine by runn...

Paperclip Processors are not loaded in Rails 3.0.0rc

I just started using paperclip and have a custom processor. I have put the new processor in the correct location RAILS_ROOT/lib/paperclip_processors But, it does not get loaded. The reason for not loading, is that Rails.root is nil at the time paperclip is loaded. I've tested this by putting explicit code into the paperclip.rb puts "W...

How to thumbnail a multi-page pdf with paperclip

I'd like to have Paperclip create 2 thumbnails for each page of a multipage PDF file that is uploaded. I'm running Paperclip 2.3.1.1 and using this in my Asset model: has_attached_file :asset, :styles => { :medium => "800x600>", :thumb => "100x100>" } So, when I upload a 3 page pdf file, I was hoping this would ...

Mass downloading from Rails (maybe with Paperclip)

I need to allow multiple downloading of small documents in Rails, preferably using Paperclip (I've already used it to enable uploading). Specific needs: Zip the files for download. Download different file types together (.jpeg, .doc, docx, .pdf). I have found lots of tutorials online for multiple uploading, but not for downloads. I...

Paperclip with albums

I'm struggling with paperclip and adding the attached images to albums. Should I be writing an album_id to the images row in the database? Right now, I'm trying to use an album model, which belongs_to :user and has_many :photos. The photo model belongs_to :album and has_attached_file. Is that the way to go about it? I'm really new to Ra...

How Can I Trigger a Scanner from a Browser?

I have Fujitsu fi-6130 TWAIN / ISIS scanners that I'd like to trigger from a button in a jQuery Rails web page. Not only would I like to have the page tell the scanner to "go", I'd also like to upload the resulting file via Paperclip once the (single) page is scanned - ideally without requiring the user to navigate a file explorer widge...

Rails Paperclip polymorphic styles

I'm using paperclip for attachments for multiple models using accepts_nested_attributes_for. Is there a way I can specify specific paperclip style options for each model? ...

How to make an assets folder private in rails?

I'm using Paperclip for letting users upload photos to my app. Then, I'm saving the photos in /public/photos. Now, I want the photos being accessible just for some users. How can I set this permission system up? ...

BrowserCMS and Paperclip

BrowserCMS can "delete" objects, which basically sets the :deleted attribute to true. Paperclip runs the following code initially to get all objects of a specific class: Person.connection.select_values(Person.send(:construct_finder_sql, :select => 'id')) This might return [1, 2, 3]. Even if, say, 3 has :deleted set to true. Paperclip ...

Could paperclip handle non-image files?

I am using Ruby on Rails 2.3.5 I want to let the user upload files, not only images, but also music files or just txt documents. Could I use paperclip for this purpose (I will store those files in Amazon S3)? Is there any special things I have to note about? Or if the paperclip gem could not handle them, what could I use? ...

Paperclip plugin issue

I have a rail application, i have the feature to upload the images . In My photo.rb : has_attached_file :image, :styles => { :original => "", :thumb => "" }, :path => ":rails_root/public/attachments/albums/:album_id/photos/:id/:style/:basename.:extension", :url => "/attachments/album...

Paperclip + Rails 3 + ActionMailer (receive) + s3

I am trying to save an image attachment sent to my rails app to s3 using paperclip however I am hitting these problems: Its getting to the attachment loop and failing with a NoMethodError (undefined method `size' for #<Mail::Part: 0x2b62856e8030>): app/mailers/user_mailer.rb:23:in `receive' app/mailers/user_mailer.rb:14:in `eac...

Rails Paperclip plugin stopped working?

Hi Everyone, I am using the Paperclip plugin to manage file uploads to my application. For some reason in the last day or so the plugin/model has stopped working and now returns the following error message: Paperclip::PaperclipError in DeliversController#create Asset model missing required attr_accessor for 'data_file_name' As far ...

'No route matches' with paperclip and S3 on Heroku

Setting up paperclip to use S3 on my local dev system was a snap. However, I am not able to get it to work on Heroku. The file uploads successfully: [paperclip] Saving attachments. [paperclip] saving photos/2/small.jpg [paperclip] saving photos/2/original.jpg However, views that try to link to the upload get a routing error: Action...

model missing required attr_accessor for 'photo_file_name' when uploading with paperclip and S3 on heroku

Setting up paperclip with S3 in my linux dev environment was a snap -- everything works out of the box. However, I can't get it to work on Heroku. When I try to do an upload, the log shows: Processing ItemsController#create (for 72.177.97.9 at 2010-08-26 16:35:14) [POST] Parameters: {"commit"=>"Create", "authenticity_token"=>"0Hy3...

Automatically grouping images into albums

We're building a piece of forum software for a client. On posts, they want users to be able to upload images (we're using paperclip right now) to insert into the body of the post (similar to wordpress). But they want the system to be able to detect if a number of photos are grouped together, and if so show them in a gallery view (thumbna...

Is it possible to use Paperclip for atacching existing files to a model?

I have a bunch of files in the server and I want to link them to a model with paperclip, since I want to generate the thumbnails and save their info in the database, just as if I uploaded with a form. Is it possible to use a console command passing the file paths for generating the Paperclip Model? ...

Paperclip with S3 on Rails 3 / uninitialized constant AWS::S3::Connection

I'm trying to upload a file to s3 using paperclip and get this error when making a new object and referencing the variable: the aws-s3 gem is installed the s3.yml file has the correct credentials ie: a = Attachment.new a.file NameError: uninitialized constant AWS::S3::Connection from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/li...

How to tell paperclip not to delete the atachment if the edit form has the file field empty?

So, I have this in my model: # app/models/interior.rb class Interior < ActiveRecord::Base belongs_to :casa has_attached_file :plano, :path => ":rails_root/public/planos_unidades/:styles/:id.:content_type_extension", :url => "/planos_unidades/:styles/:id.:content_type_extension", :styles => { :thumb => '98x98' }, :co...

Where's my Paperclip doc? Finding the right path

I have a site that saves user documents and I want to use Paperclip to display them using Google Docs Viewer (http://googledocs.blogspot.com/2009/09/view-online-files-using-google-docs.html). Paperclip is working. For instance, I have a file saved at: 127.0.0.1:3000/assets/resumes/51/original/myfile.pdf I want to display that through t...