Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

multipart/form-data requests

I'm sending multipart/form-data request from the web client, however, it's inconvinient to get to the files if there is a more than one file. HttpServletRequest comes in but JFS code created BasicHttpEntity EnclosingRequest which has file data in the entity. Are there JFS utility methods to parse that data, i.e. split it in files similarly to org.apache.commons.fileuploader API?
Thanks!

Cheers,
Alex

0 votes



4 answers

Permanent link
I'm unsure of the context where you want to parse multipart requests - is it in a fronting application?

You can just use org.apache.commons.fileupload, since it is part of the SDK.

0 votes


Permanent link
I'm unsure of the context where you want to parse multipart requests - is it in a fronting application?

You can just use org.apache.commons.fileupload, since it is part of the SDK.


The request is going to a REST service. com.ibm.team.jfs.app.servlet.AppContainerSerlet#service(...) method creates BasicHttpEntityEnclosingRequest from HttpServletRequest and puts files data into entity of the new request. How can I easily get the files out of the entity? I'd use ServletFileUploader but the request at my layer is BasicHttpEntityEnclosingRequest. Are there any utility methods to do this?
Thanks!

Cheers,
Alex

0 votes


Permanent link
Found the answer here: http://www.oreillynet.com/onjava/blog/2006/06/parsing_formdata_multiparts.html

Thought there should be a more convenient way doing this with BasicHttpEntityEnclosingRequest like it's done for HttpServletRequest with the fileuploader library you mentioned. Perhaps something some api in jfs?
MultipartStream has deprecated constructors :-/

Cheers,
Alex

0 votes


Permanent link
No, there aren't any other utilities for parsing multipart requests from HttpRequest objects that I am aware of.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 22 '11, 1:30 p.m.

Question was seen: 7,808 times

Last updated: Dec 22 '11, 1:30 p.m.

Confirmation Cancel Confirm