简体   繁体   English

Ruby中的HTTP上传服务器

[英]HTTP upload server in Ruby

I'm thinking to build an HTTP upload server in Ruby for my project. 我正在考虑为我的项目在Ruby中构建HTTP上传服务器。 So far, I'm looking at setting up a Rack server to run with "Rainbow!" 到目前为止,我正在考虑设置要与“彩虹!”一起运行的Rack服务器。 or a sinatra server with Rack middleware. 或具有Rack中间件的sinatra服务器。 The server is required to support HTTP uploads with multipart and chunking. 需要服务器支持分段和分块的HTTP上传。 Is this a good choice? 这是一个好选择吗?

I'd love to see some examples how to set up a simple HTTP upload server but I couldn't find anywhere on the 'net. 我很乐意看到一些示例,说明如何设置简单的HTTP上传服务器,但在网上找不到任何地方。

Since a file upload can take a while, an important point of uploading files in Ruby are blocking processes while a file is uploaded. 由于文件上传可能要花一些时间,因此在Ruby中上传文件的一个重要点是在文件上传时阻止进程。 You might want to look into projects that are based on EventMachine and/or Goliath to achieve non-blocking processing of HTTP requests. 您可能需要研究基于EventMachine和/或Goliath的项目,以实现HTTP请求的非阻塞处理。 Some ideas here: 这里的一些想法:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM