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

  • SEARCH
  • Home
  • 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 7752479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:48:39+00:00 2026-06-01T11:48:39+00:00

For the life of my I can’t understand how the basic paperclip example works.

  • 0

For the life of my I can’t understand how the basic paperclip example works. There’s only one line included in the controller, and that’s

@user = User.create( params[:user] )

I simply don’t understand how that’s all that is needed to upload an image to s3. I’ve changed the example quite a bit because i wanted to use jquery file uploader rather than the default rails form helper, so I’m at the point where an image is being POSTed to my controller, but I can’t figure out how I’m supposed to take the image from the params and assign it as an attachment. Here’s what I’m seeing the logs:

Parameters: {"files"=>[#<ActionDispatch::Http::UploadedFile:0x132263b98 @tempfile=#<File:/var/folders/5d/6r3qnvmx0754lr5t13_y1vd80000gn/T/RackMultipart20120329-71039-1b1ewde-0>, @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"background.png\"\r\nContent-Type: image/png\r\n", @content_type="image/png", @original_filename="background.png">], "id"=>"385"}

My JS is very simple:

 ` $('#fileupload').fileupload({
    dataType: 'json',
    url: '/my_url',
    done: function (e, data) {
        console.log('done');
    }
});`

What would be helpful for me to know is how I can strip the file data from the POSTed parameters given above and pass it to paperclip. I’m sure that I’ll have to assign the attachment attribute a value of File.open(…), but I dont know what source of my file is.

I’ve spent a ridiculous amount of time trying to figure this out and I can’t seem to get it. I’ve tried uploading directly to s3, but the chain of events was terribly confusing, so I want to get this simple pass-through example completed first. Thanks so much for any help you cna give!

  • 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-06-01T11:48:41+00:00Added an answer on June 1, 2026 at 11:48 am

    You need a few more pieces and it will help if you can show the exact code you’re using.

    Paperclip can post to S3 by using:

    http://rubydoc.info/gems/paperclip/Paperclip/Storage/S3

    When your controller creates a User model, it is sending along all the params. This is called “mass assignment” (be sure to read about attr_accessible).

    When your model receives the params, it uses the Paperclip AWS processor, which uploads it.

    You need the AWS gem, a valid bucket on S3, and a config file.

    Try this blog post and let us know if it helps you:

    http://blog.trydionel.com/2009/11/08/using-paperclip-with-amazon-s3/

    UPDATE 2013-04-03: Pleases see Chloe’s comment below– you may need an additional parameter, and the blog post may be outdated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When in the view life cycle can you change the values of objects that
Greets, Made some app on android. I for the life of me can't get
I can't for the life of me find a way to make this work.
I can't for the life of me figure out how to do this properly.
I can't for the life of me figure out why this doesn't work. I've
I can't for the life of me figure out why the following produces the
Can't for the life of me figure out what I'm doing wrong... Downloaded Kohaml
I can't for the life of me find any answer to this through conventional
I can't for the life of me figure out how to compile and link
I can't for the life of me find any decent explanation of the [file]:

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.