paperclip

rails paperclip default image with S3

柔情痞子 提交于 2019-12-03 00:21:00
I'm trying to use the default_url in my application but I store the images using S3. I'm not sure what URL I need to put in there or if I have to create a fake image just to get everything up there. Since my images always render through S3, I don't know if it would work if I just put in some default images in my public folder. It doesn't seem to be working now - I also only have one image in there, and I know it has to resize. I can manually put the resized images in there but I'm still not sure what URL to use with default. Please help :) Casper Fabricius I use paperclip with S3 with default

Paperclip, Delayed Job, S3, Heroku - design for delayed processing of sensitive uploaded files: db or s3?

穿精又带淫゛_ 提交于 2019-12-02 21:22:14
I need feedback on the design for uploading and delayed processing of a file using heroku, paperclip, delayed job and, if necessary, s3. Parts of it have been discussed in other places but I couldn't find a complete discussion anywhere. Task description: Upload file (using paperclip to s3/db on heroku). File needs to be private as it contains sensitive data. Queue file for processing (delayed job) Job gets run in queue File is retrieved (from s3/db), and processing is completed File is deleted (from s3/db) Since I am using delayed job, I have to decide between storing the file in the database

Is Rails Paperclip only for Images?

放肆的年华 提交于 2019-12-02 20:41:50
问题 Are there any rails libraries for managing file attachments connected with ActiveRecord? I know paperclip , but it seems suitable for images primarily. They indeed mention audio and pdf files on the github project page, but there's no further explanation about the usage of different file types. Attributes like :style would change their meaning if you uploaded an audio file. So different file sizes wouldn't be expressed in a two-dimensional resolution but in terms of bitrates. Are there any

everytime push to heroku, images is not showed ,paperclip

风流意气都作罢 提交于 2019-12-02 19:46:52
here was my situation. I was using paperclip to let user upload images. It did well and everything was okay. Then,I pushed it to heroku. For the momment, I can see all my images that was just upload by users. However, everytime make a new commit and push to heroku again, all of my previous images gone. It's seems like dont have the file anymore,cant load it. So,here what i thought: Is it every time i pushed to the heroku server, the images file that was in local was uploaded to the heroku server? I did research for my problem for it,and im not really understand what they actually said about

How to use Rails and Paperclip to store photos on Google Cloud Storage?

强颜欢笑 提交于 2019-12-02 19:35:50
Until now, I have been using Amazon S3 for storing users' files. All what has been needed to do here was: specify Amazon S3 credentials to the bucket add 'aws-sdk' gem to the Gemfile and in the model: has_attached_file :avatar, :styles => { :big => "100x100#", :thumb => "25x25#" }, :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", :path => ":rails_root/public/users/:id/:style/:basename.:extension", :url => "/users/:id/:style/:basename.:extension" To set the Amazon S3 adapter. That was all. But how to set up Google cloud engine? So far I found only the fog gem , which I could

uploading a file to Rails JSON API server with Paperclip and Multipart request

泄露秘密 提交于 2019-12-02 18:26:46
I want to upload a file from an Android client to a Rails JSON API server. I'm sending a Multipart/form request from the Android client which looks like that: Content-Type: multipart/form-data; boundary=d99ArGa2SaAsrXaGL_AdkNlmGn2wuflo5 Host: 10.0.2.2:3000 Connection: Keep-Alive User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4) --d99ArGa2SaAsrXaGL_AdkNlmGn2wuflo5 Content-Disposition: form-data; name="POSTDATA" Content-Type: application/json; charset=UTF-8 Content-Transfer-Encoding: 8bit {"tags":["test"],"location_id":1,"post":{"content":"test"}} --d99ArGa2SaAsrXaGL_AdkNlmGn2wuflo5 Content

Custom thumbnails for file types with Paperclip

烈酒焚心 提交于 2019-12-02 18:26:00
I'm using Paperclip with a Ruby on Rails to attach assets to a model, these assets can be any file type and currently thumbnails are only being generated if the asset is an image. I'd like to be able to display a different default image for other files, either by generating a thumbnail of the files on upload, or setting something up with the default_url but so far I can't find any resources to help with this and am getting no where on my own. My model is as follows: class Asset < ActiveRecord::Base has_attached_file :media, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",

Ruby on Rails, Paperclip, Heroku, GitHub and AWS - securing keys

拥有回忆 提交于 2019-12-02 17:43:18
I'm using RoR hosted by Heroku and I'd like to store files on s3 using paperclip. My source code is hosted on github and is world readable. What is the best practice to keep the keys a secret from the rest of the world? Paperclip suggests that the access keys are stored in a configuration file (or in code), so for example I have: file: config/s3.yml access_key_id: my_access_key_id secret_access_key: my_very_secret_key bucket: bucket_name Heroku works by committing code to local git and then pushing it to Heroku. Since I'm also using github, I push the same code to github as well. That means

Rails 3.1 + Paperclip + jQuery fileupload

自闭症网瘾萝莉.ら 提交于 2019-12-02 17:20:20
I've been looking for a way to set up Ruby on Rails 3.1 with Paperclip and jQuery fileupload . Looking at a tutorial at jQuery fileupload page I got the system set up but I can't find a way to make paperclip process the uploaded file. Here's what I have (in short): # model has_attached_file :photo ... # view = form_for @user, :html => {:multipart => true} do |f| f.file_field :photo, :multiple => true f.submit # controller def create @user = User.new params[:user] if @user.save render :json => [...] end If I inspect submitted data I get all user properties in params[:user] and params[:user][

Generating Paperclip image uploads with fake data - Ruby on Rails Populator / Faker Gems

旧城冷巷雨未停 提交于 2019-12-02 17:14:38
I am currently trying to populate a development database on a project with a bunch of fake data, to simulate how it will look and operate with hundreds of articles / users. I looked into different gems to do the task - such as Factory Girl, but documentation was very lacking and I didn't get it - but ended up using the Populator and Faker gems and did the following rake task... namespace :db do desc "Testing populator" task :populate => :environment do require "populator" require "faker" User.populate 3 do |user| name = Faker::Internet.user_name user.name = name user.cached_slug = name user