Reputation: 611
I have a very simple custom java web server (no servlets etc). I need to support file uploads via browser. Anyone has a pointer?
Upvotes: 0
Views: 209
Reputation: 2635
Consider using http://commons.apache.org/fileupload/, fairly easy to implement if you dont mind 3rd party dependencies...
Upvotes: 1
Reputation: 11194
Then you need to implement this RFC http://www.ietf.org/rfc/rfc2388.txt
I suggest you take a look at some open source implementation; I find that Jetty's is pretty straight forward, you can take a look at their code here http://repo1.maven.org/maven2/org/mortbay/jetty/jetty/
I think you can even reuse some of their code at a binary level if you are ok with this or take it as an implementation hint if you prefer the exercise of writing it from scratch.
Upvotes: 1