paperclip

Paperclip w/ Imagemagick, Amazon S3 and Heroku - Imagemagick & S3 work, but the Paperclip fields don't get set in database. Works fine in dev

蓝咒 提交于 2019-12-21 20:25:44
问题 I'm using Paperclip with Imagemagick in my app, using Amazon S3 for storage. Everything works fine in development. But in production on Heroku it's not working correctly. The image gets uploaded to Amazon S3, and the thumbnail creation works, so that part of the Paperclip, Imagemagick and S3 combo is working ok. But for some reason, the Paperclip specific model fields are not getting filled: imagestore_file_name: imagestore_content_type: imagestore_file_size: imagestore_updated_at: In

Can't upload image using Paperclip 4.0 Rails 3

限于喜欢 提交于 2019-12-21 16:57:22
问题 I've installed ImageMagick and I've installed the gem Paperclip (version 4.0). I've added: Paperclip.options[:command_path] = 'C:\Program Files\ImageMagick-6.8.8-Q16' to the development.rb My photo.rb Model has this: has_attached_file :image validates_attachment_content_type :image, :content_type => ['image/jpeg', 'image/png', 'image/jpg'] I can choose a file in photos/new.html.erb but once I click on 'Create photo' button, the page reloads with a Paperclip specific error message saying: 1

Can't upload image using Paperclip 4.0 Rails 3

泄露秘密 提交于 2019-12-21 16:57:04
问题 I've installed ImageMagick and I've installed the gem Paperclip (version 4.0). I've added: Paperclip.options[:command_path] = 'C:\Program Files\ImageMagick-6.8.8-Q16' to the development.rb My photo.rb Model has this: has_attached_file :image validates_attachment_content_type :image, :content_type => ['image/jpeg', 'image/png', 'image/jpg'] I can choose a file in photos/new.html.erb but once I click on 'Create photo' button, the page reloads with a Paperclip specific error message saying: 1

How to Upload a multipage PDF and convert it to JPEG with Paperclip?

喜你入骨 提交于 2019-12-21 13:07:15
问题 Does anyone know how to upload a multi-page pdf with Paperclip and convert each page into a Jpeg? So far, every time I upload a PDF, it only allows me to see the first page of the PDF as a JPEG. But I would like to be able to upload and convert every page from the PDF into a JPEG. Is there any gem or plug-in that can help me upload a 10-pg PDF and Convert/Store in the Database as 10 JPEG files? I have looked at docsplit-images gem, but I am not sure if that is the solution best solution or

Remove question mark from Paperclip-generated files in Ruby on Rails 3.2.6

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 12:06:59
问题 I'm using Paperclip-FFMEG to upload video files to my development environment (and, eventually, to a local server when my project goes into production). When videos are uploaded, the filename is, by default, as follows: /system/modelnames/paperclipnames/.../mynewfile.mp4?xxxxxxxxxx I believe the 10 digit figure after the questionmark is a timestamp. However, the player I will be using to play the videos doesn't like to have anything after the file attachment - so I would like to strip the

Easy way to do ajax uploading with paperclip in rails?

感情迁移 提交于 2019-12-21 09:33:56
问题 I was wondering if there was an easy way e.g. a plugin, to do ajax uploading in rails with paperclip or am I going to have to build it from scratch? Cheers! Edit: Also, I'm looking for a non-flash solution. 回答1: You can try remotipart (http://os.alfajango.com/remotipart). It's a gem fine integrated with Rails 3.1 and 3.0. I have tried it, and all the ajax-file-upload handled like magic. 回答2: I had this problem. Perhaps my solution is your solution Problem paperclip with ajax 回答3: EDIT: You'll

store images locally for development s3 for production Rails Paperclip

核能气质少年 提交于 2019-12-21 06:55:59
问题 I want to upload images on my local machine for development but store them on my Amazon S3 account for production. upload.rb if Rails.env.development? has_attached_file :photo, :styles => { :thumb => '40x40#', :medium => '150x200>', :large => '300x300>'}, :convert_options => { :thumb => "-quality 92", :medium => "-quality 92", :large => "-quality 92" }, :processors => [:cropper] else has_attached_file :photo, :styles => { :thumb => '40x40#', :medium => '150x200>', :large => '300x300>'},

File upload field causing ActionController::InvalidAuthenticityToken exception

若如初见. 提交于 2019-12-21 06:48:48
问题 Using rails 4, and trying to add a file field to an existing form, using simple_form and paperclip. Here's the critical part of the form: <%= simple_form_for(@employee, html: { class: 'form-horizontal requires', multipart: true}, remote: true) do |f| %> <%= f.input :avatar %> <% end %> Everything works ok, unless I actually submit the form with an uploaded file. Then, I get this: ActionController::InvalidAuthenticityToken in EmployeesController#update What am I doing wrong here? 回答1: The

Paperclipped on Heroku?

旧街凉风 提交于 2019-12-21 04:07:31
问题 I was curious if anyone could get paperclipped working on Heroku without using S3. I'm assuming Heroku is a read-only system, but there must be some way to save images there. 回答1: You can't write to Heroku's file system, so no, there is no way to save images the way you want. Your options are using a service like S3, or storing them in the database. I recommend using S3, because databases are not optimized for file storage. It's worth reading Heroku's documentation on file uploads. 回答2: You

Paperclip and Amazon S3 how to do paths?

为君一笑 提交于 2019-12-21 03:42:46
问题 How do I create paths with paperclip when using Amazon S3? My directory on my bucket is: /image/:id/:filename My model: has_attached_file :image, :storage => :s3, :bucket => 'mybucket', :s3_credentials => { :access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET'] } 回答1: Try this: has_attached_file :image, :storage => :s3, :bucket => 'mybucket', :path => "/image/:id/:filename", :s3_credentials => { :access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET'] } 回答2: I