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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:22:23+00:00 2026-05-29T20:22:23+00:00

This is a little out of the ordinary for a normal Ruby/Rails application. I

  • 0

This is a little out of the ordinary for a normal Ruby/Rails application. I am building an application that mostly runs on top of Event Machine. There are a few HTML files that are served up from WEBrick, but the majority of the application runs client-side with javascript, with a Web Socket connection to my Event Machine application. I need to be able to accept file uploads and store them locally. How can this be done?

Update: If you’re interested, here is a link to the source code.

  • 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-29T20:22:26+00:00Added an answer on May 29, 2026 at 8:22 pm

    First here is how to build a simple file upload with sinatra: File upload with Sinatra

    So now to run your web server with thin you can do this in your code:

    class MyWebApp < Sinatra::Base
      # here goes the sinatra app code
      post '/something' do
        # ...
      end
    end
    
    EM::run do
      Thin::Server.start('0.0.0.0', 8000) do
        map('/'){ run MyWebApp.new }
      end
    end
    

    thin uses eventmachine internally, I suppose webrick uses threads but honestly I never really looked into it.

    You should use apache or nginx in front of your ruby process at least for the file upload (I think websockets won’t work through it).
    I can include a simple nginx config if you need (just need to find it on my disk xD).

    Edit: Another solution is to use goliath as web server, you have an example here: https://github.com/postrank-labs/goliath/blob/master/examples/async_upload.rb
    If you don’t need to display upload progress you should stay with sinatra+nginx/apache.

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

Sidebar

Related Questions

I have this little problem, that I cannot figure out which arguments to pass
This might be a little bit odd question, but Im trying to figure out
It's little embarrassing to ask this question. But I can't figure out a way
I know I'm close to figuring this out but need a little help. What
I have this little code which lists all matches of items that contains the
I have this little piece of code that just checks for a particular text
So I have this little piece of code: System.out.println(Size: + mounts.keySet().size()); for (JHttpPath entry
So I wrote this little bit of code to try out some new way
I know this has been covered so much but I'm a little out of
I know iBooks has this little nuance built in. Has anyone figured out how

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.