r.sendecky
r.sendecky

Reputation: 10383

Snap: Handling multipart/form-data with mixed type input fields

I have a multipart data form with mixed type input fields. Something like this.

<form method="post" enctype="multipart/form-data" action="/files/upload">
  <input name="files" type="file" multiple />
  <input name="category" type="text" />
  <input name="description" type="text" />

  <input type="submit" value="Submit"/>
</form>

This should be pretty common as you'd want to supply some other data along with the actual file upload: group, description etc.

So since this is a multipart form data the usual "getPostParams" is out of the question. If I handle it normal way with "handleMultipart", it does not even pick up the text fields. Processing the above form with "handleMultipart" returns me a list with one part instead of three, which means it ignores the text input fields.

Any idea how to deal with it? How would I process the above form?

According to my research, if you mix fields in a multipart form you get an mime encoded message which should still contain all the fields.

Upvotes: 0

Views: 464

Answers (1)

mightybyte
mightybyte

Reputation: 7282

Anything in the form that is not a file should be put into rqParams/rqPostParams. If they are not there, then you should submit a bug report. Try to be as detailed as possible.

Upvotes: 1

Related Questions