-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multipart/form-data #47
Comments
@Adam-Stomski I looked through reel, sinatra, and rack code... Looks like rack handles this, merging a tempfile into the params in this case. I'm now confused as to whether this type of thing should be in reel or angelo (though I think it should definitely be in one). I'm guessing that it "works" if using reel-rack. @tarcieri @digitalextremist thoughts? |
Putting it in reel would mean people wouldn't have to re-invent it. But I On Thu, Feb 19, 2015 at 11:14 AM, kenichi nakamura <[email protected]
|
@tommay I thought I had looked at it quite a bit, but realized that I completely missed the |
I could go either way on this one. Reel is trying to provide a lightweight, below-Rack level abstraction, but if you really think it makes sense to add it to Reel I'd be ok with that. |
This is something I have code for, per celluloid/reel#149 ... @Adam-Stomski I believe mulitipart form-data ought to be in One thing I did notice though, is that form-data is always parsed in |
FWIW, @ixti is working on this sort of thing in https://github.com/httprb/form_data.rb |
@tarcieri I remember you mentioning that, and I checked it out. The server-side handling of multipart requests seems undocumented. The gem seems geared toward acting as a client posting requests right now, but I'm sure when I did further I'll find a parser. This is the one I've been using myself: https://github.com/danabr/multipart-parser If @ixti's gem is going to be more active, I'll switch over to that myself also, and in fact remove my multipart form-data bolt on, and pull this into |
yeah, i don't see any server-side parsing in that |
Nonexistent at the moment, but potentially something @ixti might be interested in adding |
Maybe I'll work with @ixti to add support for parsing on the server-side. @kenichi, do you have specific hopes for multipart support for your DSL? I also have a Reel-based DSL, and I'd rather not custom tailor the implementation of multipart to mine... or Sinatra/Rack either. Question for @kenichi and @tarcieri: is it acceptable to use a "hijack" style handling of multipart form-data, in this sense -- when we hijack a websocket in the |
@digitalextremist i have no specific hopes for multipart support in angelo; however, i do agree now that it should be handled in reel, so our respective DSLs can build off that. As for reel-rack support, if it doesn't work now, I see no problem in it continuing to not work :) but i think maybe an off-switch that reel-rack can set so rack can attempt to do it's thing may be a good idea. my thoughts, as not fully formed as they are, lean towards some methods added to Reel::Request like in your issue. |
So there is still no solution? Any idea/best practice on how to handle file uploads with angelo? |
@pachacamac hello! last summer, i was able to help a google summer of code student through adding rudimentary support for both sessions and multipart to reel. it's not merged yet, and still a bit rough, but you can try it: Gemfile: gem 'reel', github: 'pulkit4tech/reel', branch: 'gsoc16' Angelo app class file: require 'reel/request/multipart'
# ...
post '/' do
halt 400 unless request.multipart?
request.multipart.each do |filename, mp|
puts "received file: '#{filename}'"
puts "#{mp[:data].size} bytes, #{mp[:data].path}"
end
redirect '/'
end |
Does angelo support file uploads? Im trying to send file from Rails apllication to angelo server with form like
server code:
and log:
The text was updated successfully, but these errors were encountered: