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

Migrating from paperclip to carrierwave using previous paperclip attachment uploaded to amazon S3 #2741

Open
senaxor opened this issue May 11, 2024 · 0 comments

Comments

@senaxor
Copy link

senaxor commented May 11, 2024

my paperclip attachments urls are in this format: "https://static.tagmond.com/static.tagmond.com/stores/banners/000/000/032/original/cover_large_app_2.jpg"

so i added

    def paperclip_path
     'stores/banners/:id_partition/:style/:basename.:extension'
   end

in my store_banner_uploader.rb
so here in my carrierwave.rb:
require 'carrierwave/storage/fog'

CarrierWave.configure do |config|
  config.storage = :fog
  config.fog_provider = 'fog/aws'
  config.fog_credentials = {
    provider: 'AWS',
    aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
    aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
    region: ENV['AWS_REGION'],  //"eu-north-1"


    
    # host: ENV['S3_HOST_NAME'], //"aws.tagmond.com"
    # endpoint: "https://static.tagmond.com"
  }
  config.fog_directory  = ENV['S3_BUCKET_NAME'] //"static.tagmond.com"

actually my question is how to set these three host, endpoint and fog_directory ??

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

1 participant