0

I've been running some of the examples for MSF4J. Im looking into creating a service that allows uploading of files, but they are send using multipart/form-data. Our front sends the data with chunked encoding. So, the FileServer example shows how to handle chunked streams with the HttpStreamer and the Formparam examples show how to handle multipart/form-data. But when I send a chunked request to the /simpleFormStreaming, it doesn't work (get a HTTP 500 response). When sending an non-chunked request (Content-Lenght is set). It does work ok. So how can I handle a multipart/form-data request that is send using chunked encoding?

Thanks,

Danny

1 Answers1

0

At the moment MSF4J doesn't support chunked data with FormParam. But you can use the HttpStreamer as in FileServer sample. HttpStreamer.chunk method will get execute for each and every chunk. You need to implement the multipart/form-data handling logic in your HttpStreamHandler implementation. I think you can use commons-file-upload directly and do the processing.

  • I've looked at commons-file-upload, but I don't see how to pass the chunks to the FileUpload handler. An example of this would be great. – Danny Kruitbosch Nov 22 '16 at 08:13