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

107
Views
Allow users to download file from S3 - Rails

I have PDF's stored on S3. Uploading them with Carrierwave works great. But how do I allow users to simple click a link to allow them to download the stored file onto their local machine? Here is my current attempt that is not working.

Controller:

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

    data = open("#{article.file}")
    send_data data, filename: "#{article.file}"
end

View:

<td><%= link_to "Download File", download_article_path(article) %></td>

This isn't giving an error but it's also not download the file onto my machine. Any help would be great thanks!

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!