When the file gets uploaded on S3 then the response from S3 bucket contains the correct url of the uploaded file. But paperclip is generating a different url from the actual one.
In my s3 bucket, there's only an uploads folder and it contains multiple subfolders with unique identifiers as their titles and each subfolder contains the actual file image.
Deprecation notice
Paperclip is currently undergoing deprecation in favor of ActiveStorage. Maintainers of this repository will no longer be tending to new issues. We're leaving the issues page open so Paperclip users can still see & search through old issues, and continue existing discussions if they wish.
When the file gets uploaded on S3 then the response from S3 bucket contains the correct url of the uploaded file. But paperclip is generating a different url from the actual one.
The correct url is something like this: https://s3-us-west-2.amazonaws.com/my-bucket-local/uploads%2F1583953531486-lj6zdckcsj-9d6384a03fcd96941890332878d5a350%2F8481.jpg
But paperclip's url for
document.file.url
is: //s3.amazonaws.com/my-bucket-local/documents/files/000/000/032/original/8481.jpg OR https://my-bucket-local.s3.us-west-2.amazonaws.com/documents/files/000/000/026/original/8481.jpg with few more params like X-Amz-Algorithm + X-Amz-Credential etc.In my Document model, I have
has_attached_file :file
Following is the configuration for development environment in my development.rb file
In my s3 bucket, there's only an uploads folder and it contains multiple subfolders with unique identifiers as their titles and each subfolder contains the actual file image.
Deprecation notice
Paperclip is currently undergoing deprecation in favor of ActiveStorage. Maintainers of this repository will no longer be tending to new issues. We're leaving the issues page open so Paperclip users can still see & search through old issues, and continue existing discussions if they wish.