Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

485
Views
OpenURI::HTTPError in ArticlesController#download 403 Forbidden - S3 - Rails

I'm simply trying to allow my app to download files that are stored on s3. This seems straight forward but I keep getting this error OpenURI::HTTPError in ArticlesController#download 403 Forbidden

Here is my controller:

def download
    article = Article.find_by(id: params[:id])

    data = File.read(open("https://s3.us-east-2.amazonaws.com/theranostics-bucket/uploads/DMS-OctoberSocialMedia.pdf"))
    send_data data, filename: "file.pdf", type: "application/pdf", disposition: 'inline', stream: 'true', buffer_size: '4096'
end

It fails on the File.read line. What am I missing? I'm using Carrierwave to upload the files which is working just fine. It's only when I try to download I'm having issues.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!