zfcampus / zf-content-negotiation

BSD 3-Clause "New" or "Revised" License
18 stars 32 forks source link

Issue with Select multiple when posting as multipart/form-data #90

Open Channad opened 7 years ago

Channad commented 7 years ago

@weierophinney @ezimuel

Hi there,

I am trying to POST some data with a file upload. The data contains a multi select field. All data is posted as multipart/form-data. However when I examine the $data at the server, it only has a single element object with the last element posted.

This is what the payload was...

------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projDesc"

Haritha Gammana
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projCategory"

3002
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projStart"

2017-10-01
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projEnd"

2017-10-31
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="applSeason"

1: '1'
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="applSeason"

3: '3'
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projObjectives"

objective One
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="projProposal"; filename=""
Content-Type: application/octet-stream

------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="createdOn"

2017-10-12 14:40:5
------WebKitFormBoundaryYcAwJ85j9fSAXt0o
Content-Disposition: form-data; name="createdBy"

user
------WebKitFormBoundaryYcAwJ85j9fSAXt0o--

And this is what the server $Data has

[12-Oct-2017 10:57:06 Europe/Berlin] Params is a:11:{s:8:"projDesc";s:15:"Haritha Gammana";s:12:"projCategory";s:4:"3002";s:9:"projStart";s:10:"2017-10-01";s:7:"projEnd";s:10:"2017-10-31";s:10:"applSeason";s:6:"3: '3'";s:14:"projObjectives";s:13:"objective One";s:12:"projProposal";s:0:"";s:9:"createdOn";s:18:"2017-10-12 14:40:5";s:9:"createdBy";s:4:"user";s:10:"modifiedOn";N;s:10:"modifiedBy";N;}

Check the input var applSeason above Is this a bug or am I doing something wrong?

Any help is much appriciated

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-content-negotiation; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-content-negotiation/issues/3.