Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5979101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:36:42+00:00 2026-05-22T21:36:42+00:00

I have a rails 3 app that allows users to share files by uploading

  • 0

I have a rails 3 app that allows users to share files by uploading them to Amazon s3 via paperclip, and I want to allow others users to download these files. However, some sort of post-processing seems to be going on with this file somewhere between my app and Amazon s3.

Here’s my code:

  has_attached_file :attachment,
                    :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", 
                    :path => ':id/:style', :bucket => "test_development"

This works fine, however if I actually go to the amazon s3 developer tools the url for the file just seems to be: http://s3.amazonaws.com/test_development/1/original without the original name or type.

I then tried using something like this: [p.attachment.url(:original, false), p.attachment_file_name].join("/")

which yields: http://s3.amazonaws.com/test_development/1/original/test.pdf

However if I got to this url I get a cryptic xml error:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>1/original/About Downloads.pdf</Key>
<RequestId>7E5CC6A01CADF831</RequestId>
<HostId>
4ruFf0JtdalnaIE/SHUAqT8hVYEda9Ul6gxNmYTIAniw7piTN+Q16uKKCzi9yezl
</HostId>
</Error>

What am I doing wrong here? I just want to upload the file to s3 without any sort of processing then download again later..how should I go about doing this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:36:42+00:00Added an answer on May 22, 2026 at 9:36 pm

    The :path option is is used as the full filename. Nothing is added, it’s only interpolated. Try :path => ':id/:style/:basename.:extension'.

    And when you change :path, you often have to change :url also.

    More infos:

    • http://rdoc.info/github/thoughtbot/paperclip/master/Paperclip/Storage/S3
    • http://rdoc.info/github/thoughtbot/paperclip/master/Paperclip/Storage/Filesystem
    • http://rdoc.info/github/thoughtbot/paperclip/master/Paperclip/ClassMethods#has_attached_file-instance_method
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app that allows users to build up a network structure
I have a single Rails 2.2.2 app that I want to 'share' with multiple
I have a Rails app which allows users to upload Excel files which need
I have built a Ruby on Rails app that allows users to track workouts.
I have built a ruby on rails app that allows for users to track
I have a rails app I am working on that allows users to create
I have a Rails app that uses STI to handle different types of Users,
I have built a Ruby on Rails (2.3.8) application that allows users to track
I am building an app using Rails 3 that allows users to submit videos.
I'm trying to allow users that have connected their Facebook accounts to my rails

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.