paperclip

Trouble adding a file stored on S3 through Paperclip as an attachment in ActionMailer

只愿长相守 提交于 2019-12-08 16:18:25
问题 I'm using Paperclip and S3 for file upload and storage in a Rails 3 app. The uploading of the files is working well, but when trying to attach an uploaded file to an email message with actionmailer, I am running into issues. After a lot of troubleshooting, hopefully someone can offer a hint. From a high level, it seems like I may need to download the file first, with some kind of download method before attaching, which is suggested here but I do not quite follow on how to implement -

heroku paperclip images appear but then disappear

元气小坏坏 提交于 2019-12-08 10:11:46
问题 I uploaded my app to heroku. The app was built with ruby on rails and had the activeadmin and paperclip gem installed. The files are configured properly and i was able to upload images using he active admin gem. this worked perfectly loaclly and worked fine on heroku until i uploaded more images, now all the images have disappeared. Any ideas on how this can be sorted? 回答1: Heroku has an ephemeral filesystem. That is because each running dyno is an independent container (much like docker)

How to display PowerPoint Presentation In Rails 4 Paperclip??/

元气小坏坏 提交于 2019-12-08 09:48:24
问题 In my application, i have uploaded PPT,PPTX files using paperclip gem. I have url like this " Presentation.last.avatar.url" = "/system/presentations/avatars/000/000/006/original/example.ppt?1411994371" Now i want to display those PPT, and PPtx files in my localhost web browser. please give me suggestions.. thanks 回答1: Assuming you mean that you want them to be embedded in the browser, I've solved this by uploading the them to Scribd in the background and then displaying the embedded widget.

Problem paperclip with ajax

﹥>﹥吖頭↗ 提交于 2019-12-08 09:25:39
问题 I am reading this tutorial : http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/ because i need Save the product images in a independent model. However when Product.create execute don´t save the data for product images model. NOTE: I use the new pack action because i need to use ajax for create a new product. Please I need Help. My Code Controllers class Admin::PacksController < ApplicationController def new @pack = Pack.new @product = Product.new 4.times {

Paperclip validation issue on production

可紊 提交于 2019-12-08 08:48:50
问题 I have a Problem when I deploy my application on google cloud I get this error has contents that are not what they are reported to be Locally it works fine! I already tried to using the command_path. So I really don't know what I have to do next... This is my model has_mongoid_attached_file :image, :styles => { :large => "380x380!" , :medium => "240x240", :small => "120x120!" }, :storage => :fog, :fog_public => true, :fog_directory => 'XXXX', :path => "images/:id/:style/:basename.:extension",

How to use paperclip with rails and how does it work in deployment?

依然范特西╮ 提交于 2019-12-08 08:45:39
问题 I've done 2 Rails apps involving image uploads with paperclip. The first one I did a while ago worked fine locally but I had issues when I deployed to Heroku; I realized I needed to use AWS to enable image uploads. I did that project a while ago. I recently started another project and tried to incorporate similar functionality. Before I enabled AWS with paperclip when I tried to deploy, I just wanted to test what would happen if I tried to upload an image. To my surprise, it worked without

RAILS - paperclip don't work with Ajax

痴心易碎 提交于 2019-12-08 07:04:42
问题 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 other idea? VP 回答1: The iframe technique is the way to go for AJAX file uploading. I currently just implemented something like this and I followed the tutorial

paperclip 2.7.0 on ruby 1.8.7

妖精的绣舞 提交于 2019-12-08 07:04:27
问题 I have a very old rails app (rails 2.3.10 and ruby 1.8.7) and we want to move it on another server. I can reinstall all gems with same version except for paperclip 2.7. when i tried to install it i receive an error on activesupport, that it seems it require ruby 1.9.3. According with paperclip doc this shouldn't happens, some one of you can help me? i tried with all gems except paperclip, with no gems, and installing an old version of activesupport. Below you can find my tests. app@new-server

Paperclip, how to append a random stamp at the end of the file?

一曲冷凌霜 提交于 2019-12-08 07:03:30
I'm using paperclip with my rails 3 app. I want to append a random string, nothing to long or crazy at the end of the file to cache bust the CDN. Anyone know a real simple way to do this? Here is what I have currently: has_attached_file :photo, :styles => { :thumb => "70x70>" }, :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", :path => "/:rails_env/public/users/:id/:style/:basename.:extension", ..... I would like a file name like FILENAME_31313.png Where 31313 is random every time a photo is saved. Thank you You can use something like this to get the job done: before_create

Paper clip files upload

痴心易碎 提交于 2019-12-08 06:03:45
问题 I have a scenario, In the same form, I have two uploads one is of image type while other one is for doc,excel and PDF etc. I am using gem 'paper-clip' for both. first I want to know how to customize and configure paper clip to upload both types, second I want to restrict both fields not to upload other type. like images fields should not accept other content type similarly vice versa. 回答1: You can check Paperclip Upload file :-- 1) In Gemfile Include the gem in your Gemfile: gem "paperclip",