paperclip

Rails - Paper_Clip - Support for Multi File Uploads

Hello, I have paper_clip installed on my Rails 3 app, and can upload a file - wow that was fun and easy! Challenge now is, allowing a user to upload multiple objects. Whether it be clicking select fileS and being able to select more than one. Or clicking a more button and getting another file upload button. I can't find any tutorials ...

Rails, Getting a File's name when uploading a file to the server

Hello. I'm using an AJAX uploader in Rails 3, along with paper_clip and have files uploading here: def upload @photo = Photo.create({ :photo => params[:file], :title => params[:filename] }) respond_to do |format| format.json end end I want to set the photo's title as the photo's filename, but don't know how t...

Rails, Uploading multiple Files to an Album

Alright this one's tricky - don't shy off! I've setup a multi-file uploader with Rails 3 + paperclip + Ajax Upload (http://valums.com/ajax-upload/) My controller is as follows (which works): def upload @photoalbum = PhotoAlbum.create @photo = @photoalbum.photos.create({ :photo => params[:file], :title => params[:filename],...

AWS::S3::MissingAccessKey in Paperclip but I've defined both.

I'm on Heroku, and this is a portfolio thing which I'm putting up on github for potential employers to look at, so obviously I don't want to stick my keys in a S3.yml file. I've exported S3_KEY and S3_SECRET to my environment both on Heroku and my machine and ruby can access them. But when I try and upload, it gives me the following erro...

rails PaperClip / S3 / ImageMagick

I'm using paperclip in my rails 3 app to upload photos, resize with ImageMagick and then post to S3. For the life of me, I can't figure out why this process is soooo slow on my localhost? Even without any resizing it's crazy slow... 30+ seconds for one photo? And my network & cpu aren't even working hard? Why? Updating with Model: c...

Rails 3 with Uploadify & Paper_Clip

Anyone here haveRails 3 with Uploadify & Paper_Clip experience? I'd like to allow the user to upload photos: Here is my view: <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript"> $(document).ready(function() { $('#fileInput').uploadify({ uploader : '/uploadify/u...

Amazon S3 path or to_file wont work

Hey guys ive got the following code in my Model require 'RMagick' class Upload < ActiveRecord::Base belongs_to :card has_attached_file :photo, :styles => { :thumb => ["100x100", :jpg], :pagesize => ["500x400", :jpg], }, :storage => :s3, ...

Rails 3 -NoMethodError (undefined method `original_filename

Hello! I'm using Rails 3, Uploadify, to send images to S3. Right now all the images being upload have the MIME: application/octet-stream I'd like to fix that but I'm getting the following error: NoMethodError (undefined method `original_filename' for #<ActiveSupport::HashWithIndifferentAccess:0x107c81998>): app/models/photo.rb:29:in...

How do I throw away the original image file and just keep the resizes with Paperclip and Rails 3?

I am using Paperclip to, among other things, allow a registered user to upload an avatar for use on thier profile. I want to store a big and small version of the image which will be rmagicked to standard sizes. Now, what i want to do, is store these two standard sizes (:normal and :tiny, for example.) but I do not want to store the :orig...

RMagick not maintained any more??

At the RMagick repo on Github, a message was uploaded yesterday saying the main author cannot continue to maintain the project, and is looking for new people to take over. (I would certainly crash it were I to ever attempt such a job!). You can see their readme here: http://github.com/rmagick/rmagick. In your opinion, where should a Rai...

Paperclip and failed validation - avoid reupload

Hello, I am currently setting up Paperclip for a model with Rails 3. When one of the fields fails validation (title), the user has to upload the file again. This is not very user friendly :/ The recommendation from the Paperclip forum is to move the Paperclip stuff into a related model. My model is very simple with just a few fields, ...

Paperclip attachments with dynamic style sizes from Model

Using Rails 2, I try to separate different, dynamic image sizes trough another Model from the Paperclip-Model. My current approach, using a Proc, looks the following: class File < ActiveRecord::Base has_many :sizes, :class_name => "FileSize" has_attached_file( :attachment, :styles => Proc.new { |instance| instance.attachment...

Rails: How can I edit text files stored on Amazon S3?

I'm using paperclip to upload some text/csv files to an S3 bucket. I need to edit those files occasionally. How can I edit and re-save those? Before using S3, I was just using File.open for saving the files, but that throws a "No such file or directory" error now. ...

fakefs + paperclip on rails3 + rspec2 will give me an error "cannot generate tempfile"

rails (3.0.1) fakefs (0.2.1) paperclip (2.3.4) rspec (2.0.1) I am testing my model with rspec. Since this is a test, I want to prevent any file creations under the public directory as paperclip normally does. I am thinking this workaround is to use fakefs. Although I implemented this http://trevorturk.com/2008/12/11/easy-upload-via-u...

RAILS: paperclip and creation date based directory structure

Hi there, does anyone know how I can configure my rails model, which is using paperclip for data storage, to use creation date based directories like for example in fleximage ?? At present I'm using: has_attached_file :bookblock, :path => "#{CONF['storage_path']}bookblock/:id_partition/:style.:content_type_ehas_attached_filextension" ...

Create paperclip attachment from rmagick image

Hi, I have a problem to find a way to save an image created with RMagick in a paperclip attachment. imageList = Magick::ImageList.new imageList.new("images/apple.gif", "images/overlay.png") ... picture = imageList.flatten_images I am in a model that have an attached file has_attached_file :picture, :url => ..., :path => ... ...

How to proxy files from S3 through rails application to avoid leeching?

In order to avoid hot-linking, S3 bandwidth leeching, etc I would like to make my bucket private and serve the files through a Rails app. Concept in general sounds very easy, but I am not entirely sure which approach would be the best for the situation. I am using paperclip for general asset management. Is there any build-in way to achi...

paperclip custom :path and :url

Hi, I have some problems trying to custom the :path and :url options for has_attached_file with paperclip: I have a polymorphic class named "Asset" that have : class Asset < ActiveRecord::Base belongs_to :file_owner, :polymorphic => true has_attached_file :picture, :styles => { ...}, :url => "/attachments/user_:use...

Paperclip :style depending on model (has_many polymorphic images)

Hello, I have set up my models to use a polymorphic Image model. This is working fine, however I am wondering if it is possible to change the :styles setting for each model. Found some examples using STI (Model < Image) However this is not an option for me, because I am using a has_many relation. Art has_many :images, :as => :imageabl...

Paperclip thumbnail regeneration timeout?

I'm trying to run the Paperclip thumbnail regeneration task using paperclip:refresh:thumbnails CLASS=Photo but after sitting for ~5 minutes, I get a "rake aborted! Broken pipe" error. The images are stored on S3. Here is the full trace on the task: Shpigford:pugspot_v3 Shpigford$ rake paperclip:refresh:thumbnails CLASS=Photo --trace (...