paperclip

How to remove a specific file in Rails public folder?

User in my web app are able to upload file. I use Paperclip to handle file attachment issue. Is there any method if I would like to remove any specific user-uploaded file programmatically? ...

Error in paper clip plugin in rails

Image Paperclip::CommandNotFoundError I am getting this error. Installed Image magick, rmagic both specified path in developement.rb Paperclip.options[:command_path] = "/opt/local/bin" Using Snow Leapord ...

how can i save a photo without submitting a form, rails

If i allready have a photo in my filesystem how can i save it without submitting a form? I would like to do that in a controller when some action occurs. I am using paperclip to save my photos. so if you have any idea how to make paperclip save it it would also be very helpful. Paperclip: I allready have a photo saved with paperclip. ...

PNG black background transparent images Ruby on Rails application

Hello, I am currently running a Ruby on Rails application with Imagemagick and Paperclip and have a problem with PNG transparent images. They show with a black background and I'd like to know how to do to make that background show white. I found some resources but unfortunately only in PHP. Would be great if you could share with me a so...

How can I change the upload directory for paperclip on heroku to /tmp?

I need to upload files and then parse them using paperclip? Currently it is uploaded in the /system folder, which isn't allowed in heroku. I don't need the uploads to be persistent...I parse it and then store them. So I'd like to be able to save into /tmp and then parse, and then let it get blown away later. Thoughts on how to do thi...

Exception when trying to upload file from Flex to Rails (using paperclip)

I'm trying to upload a Dynamically generated file from Flex (PNG image) to Ruby on Rails Server back end using the following code (from Flex on Rails book): public function save():void { var bitmapData:BitmapData = new BitmapData(width, height); bitmapData.draw(this); var ba:ByteArra...

How do I have different paperclip paths set depending on whether in development or production in rails?

I am using Heroku for my production environment so I need to load the paperclip files into different directories. For development I want it to continue in the current /system default, and in production I want to pass the :path variable to a /tmp directory per Heroku. How do I do this? Am guessing maybe set something in the environment...

Can paperclip read photo geometry off an S3 bucket?

I would like to read the geometry of a photo off of my S3 container. When it's on my local, this works : def photo_geometry(style = :original) @geometry ||= {} @geometry[style] ||= Paperclip::Geometry.from_file photo.path(style) end But it doesn't seem to work when I switch my model over to S3.. Any recommendations? The bigger s...

Validate Attachment Content Type Paperclip

Is it possible to enforce a 'content type' validation in paperclip without enforcing a 'presence' validation (i.e. allow blanks)? I currently have: class Person < ActiveRecord::Base has_attached_file :picture validates_attachment_content_type :picture, :content_type => ['image/jpeg', 'image/jpg', 'image/png'] end However, this fai...

How do I tell paperclip to not save the original file?

How do I tell Paperclip not to save the original file when it is uploaded? Or even better, to store a scaled version of the file as the original? ...

Rspec tests hanging with Paperclip

I have a Picture model in my app that uses Paperclip to attach an image to it. The model: class Picture < ActiveRecord::Base has_attached_file :image, :default_url => "/system/:attachment/missing.png", :styles => { :small => "100x100#", :medium => "460x460>", :large => "1024x1024>" } validates_attachment_presence :image validate...

Paperclip image uploads in Rails - Paperclip::CommandNotFoundError

I'm using paperclip to handle image uploads to rails. it worked fine on my dev OSX machine, but now on my web server I get this error: [paperclip] /Users/marky/bin/identify '-format' '%wx%h' '/tmp/stream,16451,2.JPG[0]' 2>/dev/null [paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Paperclip::CommandN...

Paperclip ":discard_if" functionality

Hi there, I'm using Paperclip and accepts_nested_attributes for. I'm wondering what is the best way to discard photos (i.e. not save them in the db), if they have {model}_file_size == nil. This could be done using attribute_fu like in the example bellow, using the discard_if option. The Photo class uses Paperclip. However, I don't want ...

Rails: Paper Clip Cropping Syntax

What is the difference between using > or # when cropping a thumb: example: has_attached_file :image, :styles => {:small => "100x100#"} has_attached_file :image, :styles => {:small => "100x100>"} How do get a thumb that has the maxium height of 100px but variable width (to preserve the aspect ratio)? Thanks Deb ...

Rails Paperclip with model association

I have a page where I can view a product, and directly from this page the user can add and remove multiple images associated with the product. I'm using paperclip in a form to upload new file. Because multiple images can be saved for a product I created an image model belonging to the product model. It's not possible to use the default...

Frequent "No such file or directory" while saving files via Paperclip

I feel like this will end in a facepalm moment but I've been banging on my head on it for too long. I have a Rails seed.rb file that gets all the files from a specific directory creating a new object for each file and saving the file via Paperclip: Dir["./**/*.jpg"].each do |f| ... p = Picture.new File.open(f, 'r') { |photo_file|...

Inconsistent HTTP Errors from Uploading Images with Uploadify and Ruby on Rails

I'm having great difficulty in finding a bug preventing some uploads to my rails app through Uploadify. Here is the error I'm receiving: http://j.imagehost.org/0353/uploadify-errors.png The thing that's making this difficult is that it's not at all consistent. Sometimes the images will upload perfectly fine. Other times they won't. Th...

Sending images to RoR app through an API + paperclip

how can I make my rails app to receive images from clients through an API using paperclip plugin. I know how to use paperclip using the ordinary form to upload the images, but i need to send images from a mac client. thanks in advance ...

Paperclip running multiple times on each page

I am using paperclip to save photos to my users' profiles. Rails is saving the paperclip attachments multiple times every time a page loads. Any ideas on why this is happening? ...

How Do I Use Factory Girl To Generate A Paperclip Attachment?

I have model Person that has many Images, where images has a Paperclip attachment field called data, an abbreviated version displayed below: class Person has_many :images ... end class Image has_attached_file :data belongs_to :person ... end Person is required to have at least one Image attached to it. When using FactoryGi...