paperclip

Can't connect to AWS in Rails? What should I do to debug?

I have implemented paperclip in rails exactly as a variety of tutorials recommend. Upon trying to upload a photo I consistently get the following: AWS::S3::NoConnectionEstablished usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb:213:in `connection' /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/bas...

Paperclip, large file uploads, and AWS

So, I'm using Paperclip and AWS-S3, which is awesome. And it works great. Just one problem, though: I need to upload really large files. As in over 50 Megabytes. And so, nginx dies. So apparently Paperclip stores things to disk before going to S3? I found this really cool article, but it also seems to be going to disk first, and then do...

Rails Nested Object Forms with Paperclip - paperclip attrs ignored by reject_if

When submitting a nested object form, I can't get it to reject invalid child objects because the reject_if proc doesn't see the Paperclip attribute. Here are the relevant parts of my models & forms: class Stage < ActiveRecord::Base has_and_belongs_to_many :assets, :uniq => true accepts_nested_attributes_for :assets, :reject_if => l...

Paperclip, Rails 2.3.3 and OSX

Hi, I have code in view <% uberform_for :profile, :html => { :multipart => true, :method => :put }, :url => update_avatar_path do |f| %> <%= f.file_field :avatar %> <p><%= f.submit 'Upload avatar' %></p> <% end %> in controller def update_avatar current_user.profile.update_attribute(:avatar, params[:avatar]) redirect_...

Ruby on Rails / Paperclip / AWS::S3::NoSuchBucket error

Hello; I installed the paperclip plugin and was able to use it locally. When I configured it to work with amazon S3 I keep getting the NoSuchBucket (The specified bucket does not exist) error. Paperclip documentation states that the bucket will be created if it doesn't exist but clearly something is going wrong in my case. I first insa...

Secure File Upload in Ruby On Rails

I built a photo gallery which uses Paperclip and validates the content-type using validates_attachment_content_type. The application runs on a shared host with Passenger. Is it possible to bypass the validation and run malicious scripts from the public/pictures directory? If so, is there anything that I can do to avoid evil scripts fro...

How to set file programmatically using Paperclip

I have rake task to seed the application with random data using the faker gem. However, we also have images (like logos) that we want uploaded in this rake task. We already have Paperclip set up, but don't have a way to upload them programmatically in a rake task. Any ideas? ...

Paper Clip failing to save attachment

Hi, I'm using Ruby 1.9 and Rails 2.3.4 with Paperclip gem to save attachments. and I followed tutorial by adding the proper migration, adding (has_attached_file :video) to the model, making the form (multipart) and adding <%= f.file_field :video %> to it... When I try to upload a file I look in the log and I see: [paperclip] Saving at...

Paperclip for Rails: Can I access the model?

Let's say I have a model called Theme, which has several attributes setting interface colors. Theme also has a Paperclip attachment, which is a user-generated CSS template. I want to set up a processor to generate a final CSS file, inserting the interface colors into the user-generated template. To do this, I need to access the model dat...

Paperclip as a gem and Phusion Passenger (mod_rails) - can't find Paperclip

Hi, I'm using paperclip by thoughtbot for attachments to models and everything works fine on my development machine running mac os x and mongrel. However when I deploy may app to a debian machine running apache/mod_rails (2.2.5) I can't get it started. I get 'undefined method has_attached_file' (or 'uninitialized constant Paperclip' usi...

Is it an issue to create a directory for each file upload, in a web application on linux/unix?

Hi, I am doing file-upload for a web-application (running on unix/linux). I'm wondering if there would be a concern if I planned to create a new directory for each file upload? This is the out-of-the-box approach for the Ruby on Rails plugin "paperclip". I debating what the trade-offs are, or whether perhaps it's just not a concern, ...

How do I get the base URL (e.g. http://localhost:3000) of my Rails app?

I'm using Paperclip to allow users to attach things, and then I'm sending an email and wanting to attach the file to the email. I'm trying to read the file in and add it as an attachment, like so: # models/touchpoint_mailer.rb class TouchpointMailer < ActionMailer::Base def notification_email(touchpoint) recipients "[email protected]...

Paperclip Error

Hey, I'm getting the following error in my development.log [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream28514-0 is not recognized by the 'identify' command.> And i've googled about this error and i found out that many people have solved this by adding this line Pa...

Engine Yard with paperclip

Greetings, has anyone of you used the paperclip plugin on Engine Yards hosting service? Are there any problems to solve or anything to pay special attention to? Is the paperclip on heroku example of Pedro Belo fitting? Thanks for your comments, Joe ...

rails paperclip different file types problem

I'm using paperclip for uploading files, handling images is easy, but how can I handle images (png, jpg) and swf in the same upload, even pdf files, when I have to create different styles of the images but not the other formats. ...

mod_rails and Paperclip problem Paperclip::NotIdentifiedByImageMagickError

Hello, I am havingn troble deploying my app to a server runing ubuntu with mod_rails. Runing webrick on the server seems fine and I can save files, no problem. But runing the app thru nginx, I get this error when I try to save a file. [paperclip] An error was received while processing: # [paperclip] An error was received while processi...

Paperclip S3 buckets, proc and environments

From reading the documentation I understand this might be doable, but I don't know how! For the production environment I have three buckets (three models, three buckets) image-bucket, audio-bucket, pdf-bucket, but for the development environment, I want to have dev-image-bucket, dev-audio-bucket, dev-pdf-bucket. How do I set the proc?...

Rails Paperclip conflict between aws-s3 gem and right_aws gem. How to solve?

Hi, for a new App I want to use paperclip to store Files to S3. I already have installed the aws-s3 gem for another app. That seems to cause some problems, because Paperclip should use right_aws but is trying to use the aws-s3 gem. But I don't want to remove the aws-s3 gem from my system. Is there a way to solve this conflict? Maybe by ...

Paperclip gives Permission denied error with samba mount

In my development environment the codebase is mounted on a ubuntu-server VM using a samba mount, it is mounted as root and I run mongrel as root. When I try and upload a file with Paperclip the file saves fine but then it seems to have problems creating the different styles. I get the following error: Errno::EACCES (Permission denied ...

How to reformat the mp3 filename which is saved through paperclip

I upload/save mp3 files through Paperclip, it transforms the name with underscores when it saves it. For example if I upload "Gould Stokowski 1.mp3" it saves into the the db as "Gould_Stokowski_1.mp3". How can I take out the underscores (replace them with spaces" when I retrieve the file and I want to display the name. ...