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 6073185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:14:36+00:00 2026-05-23T10:14:36+00:00

Note: I’ve included all my console output as pastebin links to keep this question

  • 0

Note: I’ve included all my console output as pastebin links to keep this question easy to read …

I’m trying to create a basic image file upload for my RoR application. But every time I submit a form with the image attached (a multipart encoded form with a single file input), I get the follow error on the WEBRick console:

http://pastebin.com/2kRgTaNg

I’ve searched for a while now, and several other places mention similar problems, but the only prescription I found was to upgrade rack-test due to a bug in a particular version. I can’t seem to find which version they are referencing, and I have run gem update and bundle update to no avail. Here is the output of bundle:

http://pastebin.com/7QZtGHaG

I’m not sure what else I can do to upgrade rack-test – I’m still very new to Rails and the Linux environment in general.

One last note: although I have tried uploading several different files of varying sizes, from 4KB to 300KB, the size of the request as seen in Firebug is always 216B. I’m not super familiar with the inner workings of a multipart file upload request, but is it possible something is wrong with my HTML form itself?

Links to similar problems:

Rails3, Cucumber, Capybara, File upload => bad content body (EOFError)?

http://groups.google.com/group/cukes/browse_thread/thread/5028306893c2c54a

  • 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-23T10:14:36+00:00Added an answer on May 23, 2026 at 10:14 am

    It appears that the problem was not on the Rails side, but with my forms. I had been using this jQuery plugin to try and custom style the file input control. It works by placing a file input control with opacity:0; over whatever element you provide it (in my case, my button’s div).

    I’m not sure what was happening, but the requests were being sent out from the browser with the opening boundary for the multipart data, but no body or closing boundary. In other words, FireBug showed the outbound request payload as simply:

    ....
    
    Request Payload:
    ------WebKitFormBoundaryzwgDaIoTked9N6CB
    
    Response Headers:
    ...
    

    Instead of:

    ....
    
    Request Payload:
    ------WebKitFormBoundaryzwgDaIoTked9N6CB
    Content-Disposition: form-data; name="upload"; filename="filename.jpg"
    Content-Type: image/jpeg
    
    
    ------WebKitFormBoundaryzwgDaIoTked9N6CB--
    
    Response Headers:
    ...
    

    Once I gave up on the custom styling and simply plugged in a normal form, it all worked fine. Hopefully this is somewhat helpful to others who might encounter similar problems!

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

Sidebar

Related Questions

Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
Note : The code in this question is part of deSleeper if you want
Note This is not a REBOL-specific question. You can answer it in any language.
Note: This is a follow-up to an answer on a previous question . I'm
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note The question below was asked in 2008 about some code from 2003. As
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
Note: I'm more interested in understanding general Go concepts/patterns, rather than solving this contrived
Note, this might perhaps be best suited on serverfault.com, but since it is about

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.