SimpleHttpServer
SimpleHttpServer copied to clipboard
handle multipart/form-data post uploads
When trying for example send a text file using curl $ curl -F [email protected] http://localhost:8080
You can see that there is still header info in the actual data, this needs to be stripped of, somehow related to this.
Correct... SimpleHttpServer does not currently handle multipart-post file upload, only application/x-www-form-urlencoded. It is a small educational server designed to learn the basics of HTTP.. Right now, the code should probably be checking the POST content type and throwing an exception on unhandled multipart/form-data uploads.
The link you posted does discuss multi-part form upload. Unfortunately, the example PopulatePostMultiPart won't handle binary data or large uploads, because it's decoding everything into a string. Here is a better description...
http://stackoverflow.com/questions/8659808/how-does-http-file-upload-work
Good article, i was thinking would be wise to just encode the binary, like base64 and send it as string, That is handle in easier way by http and can be decode in the server side.
It is not easier to base64 the data. All that is needed is to properly implement multi-part file upload on the server.
If it will help, i can spend some time implementing this. It is not hard.