ruby on rails - Store paperclip files only on s3 -
Text after "
Is it possible to store files only on S3?
I only need to download and metadata store because the paperclip is required to upload the file directly to S3
EDIT: I already use S3 storage but this Prior to uploading to the S3 Store on file system before configuration paperclip. Partially solved by uploading the same file from the paperclip S3 / on the model, making the download file, check the content type and other default items.
After the text "itemprop =" text ">
has been mentioned from India, you can do this like this:
# config / environment / production.rb Paperclip :: Attachment.default_options.merge ({storage !: S3, s3_host_name: 's3-eu-west-1.amazonaws.com', s3_credentials: {access_key_id: ENV [ AWS_ACCESS_KEY_ID '], secret_access_key: ENV [' AWS_SECRET_ACCESS_KEY ']}, BUCKET: ENV [' S3_BUCKET_NAME ']})
This requires your "default" settings to upload the required files in S3
Paperclip
You have to remember that the paperclip is actually "Store" does not file - it's only active Record & amp; Your storage facility
Most applications will store the file in the local file structure ( / public / system
), but using s3:
storage settings , You will be able to upload them directly to S3
Comments
Post a Comment