Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with file cache on form validation using S3 #2022

Closed
lemingos opened this issue Sep 19, 2016 · 1 comment
Closed

Problem with file cache on form validation using S3 #2022

lemingos opened this issue Sep 19, 2016 · 1 comment

Comments

@lemingos
Copy link

lemingos commented Sep 19, 2016

Hi,

I am using Carrierwave + Fog to store files on S3.
It works when form is saved successfuly without any errors, file is save to S3.
It doesn't work when object is not valid and file is saved to temporary location.
In that case file is saved to application server public/uploads/tmp directory - but the app is looking for that file on S3.

Please advise.

Here is my config:

 CarrierWave.configure do |config|
    config.fog_credentials = {
      :provider                   => 'AWS',
      :aws_access_key_id          => ENV['FOG_AWS_ACCESS_KEY_ID'],
      :aws_secret_access_key      => ENV['FOG_AWS_ACCESS_KEY_SECRET'],
      :region                     => ENV['ELB_REGION'],
      :path_style                 => true
    }
    config.fog_directory        = ENV['FOG_DIRECTORY']
    config.asset_host           = ENV['ASSET_HOST_UPLOAD']
    config.storage              = :fog
  end
@lemingos lemingos changed the title Problem with file cache on form validation Problem with file cache on form validation using S3 Sep 19, 2016
@mshibuya
Copy link
Member

cache_storage feature works perfectly for that purpose. See #1312 for detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants