paperclip

Receiving Email (ActionMailer) with Rails to process image attachments

I am trying to parse an email sent to my app server. It should read the email to find the user by email then add the photo to the user's photo models Here is what I have so far. What am I doing wrong? class Mailman < ActionMailer::Base def receive(email) logger.info("Got an email about: #{email.subject}") if (@user = Us...

How to use paperclip with a file already on my server?

For the record, I'm working on legacy code and I'm trying to plug a new feature without breaking everything. Right now I have a bunch of files on my server as such: myapp/public/temp/myfile.doc The thing is that I want to create a Docfile object from these files in a controller action. Here is the trimmed down Docfile class: class ...

Paperclip doesn't resize uploaded pictures

Hello, I using rails 2.3.4 and PaperClip gem as plugin (the latest git master). And, given the following code: class Banner < ActiveRecord::Base has_attached_file :picture, :url => "/banners/:id/:basename.:extension", :path => ":rails_root/public/banners/:id/:basename.:extension", :styl...

RAILS - paperclip don't work with Ajax

Hi, i have an application working fine with form_for updloading an image using paperclip. The problem is, because of the javascript security model, it cannot upload a picture via AJAX. I would like to know: what is the best approach, that really works with rails 2.3.x, to send file via aJAX using rails? IFRAME technique? swfupload? Any...

Sharing Uploaded Files between multiple Rails Applications

I have multiple applications (an admin application, a "public"/non-admin application and a web service application) that all share a single database. I've gotten the applications to share models and other code where appropriate, so I don't have multiple copies of the same code in each. However, the one task that I've yet to configure...

Importing old data with Rails and Paperclip

I'm using paperclip for attachments in my application. I'm writing an import script for a bunch of old data, but I don't know how to create paperclip objects from files on disk. My first guess is to create mock CGI multipart objects, but that seems like a bit of a crude solution, and my initial attempt failed, I think because I didn't ge...

Ruby on Rails: Length of Video as a Paperclip Attachment

I created a rails class with a video attachment, and i want to know how to get the length of a video that is uploaded to my application. How can I achieve that ? ...

Image orientation and validation with Paperclip?

Hi, I'm looking for a way to determine image orientation preferably with Paperclip, but is it even possible or do I need to user RMagick or another image library for this? Case scenario: When a user uploads an image i want to check the orientation/size/dimensions to determine if the image is in portrait/landscape or square and save this...

How to use multiple S3 accounts with Paperclip and Rails

I'm fairly familiar with using Paperclip in my Rails apps and having attachments stored on S3. However, on my next project I'd like each user to use their own S3 account. Assuming I'm using restful_authentication or authlogic, what would be the best way to store each user's credentials and have Paperclip use them? ...

unit test in rails - model with paperclip

I'm trying to write a test for a model with a picture, using paperclip. I'm using the test framework default, no shoulda or rspec. In this context, how should I test it? Should I really upload a file? How should I add a file to the fixture? ...

Multiple Paperclip default_urls

I am using Paperclip to upload an image to my Project model and I want to have an array of default images (not depending on the style, but different images) is that posible? To pass an array instead of just one URL to the :default_url option? Thank you, Nicolás Hock Isaza ...

using paperclip with secure and non-secure files

First off, we have this namespaced/sti'd structure for our different types of 'Media' Media< Ar::Base Media::Local < Media Media::Local::Image < Media::Local Media::Local::Csv < Media::Local etc... etc.. This is excellent since a user can have many media, and how we display each piece of media is based on the class name and a co-resp...

Can't get ImageMagick to process uploaded images using paperclip

When I upload images I am getting the following error: [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream20091218-7204-1fuv2j1-0 is not recognized by the 'identify' command.> I have staging servers that have been setup on VMs that work fine, but once I move out to the producti...

Make a field optional in rails

I use paperclip to attach an avatar to users, which works fine but when a new user attempts to register it complains about the avatar bieng too small and not of the right type. This is how i validate my avatars: validates_attachment_size :avatar, :less_than => 1.megabytes validates_attachment_content_type :avatar, :content_type => ['im...

Rails Actionmailer Attachment Using Paperclip

Hi I have an email messaging system built within my application. There are many different users that can sign on and send emails to certain groups of people. I want to add the capability to send an attachment with these emails. I have no problem getting a set attachment from my HD to send, but clearly I need to allow users to add an att...

Multi-Model Forms with Image Upload

Hi, I'm trying to create a poll object which has many answers. Each answer can have an image attached. How can I create a form that allows me to enter the question and add a variable number of answers (each with their attached image). I'd also preferably want to allow preview of the images uploaded. My idea so far is to have a sub-form...

How do I use 'paperclip' in Eclipse RadRails perspective?

I'm a newbie Ruby on Rails developer. I have installed the 'paperclip' gem by modifying the config/environment.rb file and adding the following: config.gem 'paperclip', :source => 'http://gemcutter.org' and then running rake->gems->install and rake->gems->unpack. Now, I would like to run the 'paperclip' generator however, it does not ...

Rails, Paperclip Failing to Save File

So I'm using Thoughtbot's Paperclip on Rails, but ran into a problem where all image attributes are null: [4;35;1mProject Create (0.0ms)[0m [0mINSERT INTO `projects` (`name`, `start_date`, `status`, `image_file_size`, `updated_at`, `url`, `image_content_type`, `description`, `progress`, `image_updated_at`, `created_at`, `image_file_na...

rails paperclip and passenger `is not recognized by the 'identify' command`

When I upload a photo, my model fails validation, err well even without any validations I'm returned this error: /tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command. and /tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command. I'm confident this is not related to ImageMagick becau...

RoR: not able to connect paperclip to Amazon S3

Hi, I have decided to deploy my app to Heroku and I was following their tutorials. However, Im trying to connect to my Amazon S3 bucket with a paperclip plugin right now and Im getting this error: ArgumentError in Images#index Showing app/views/images/index.html.erb where line #19 raised: syntax error on line 0, col 39...