java - extract file name from content disposition -
my payload has content-disposition field. trying upload bpmn file. @ backend need parse input stream , extract file name. not able find solution of this. using jesrey rest.
i tried :
@post @consumes(mediatype.multipart_form_data) @produces(mediatype.application_json) public response addworkflowschema(@formdataparam("bpmndata") inputstream uploadedinputstream, string filename, @context httpservletrequest request)
to whole payload data. if remove formdataparam ma getting request body.
reuqest payload :
------webkitformboundary8ccb878tyzkse9go content-disposition: form-data; name="bpmndata"; filename="process.bpmn" content-type: application/octet-stream ------webkitformboundary8ccb878tyzkse9go--
i need filename content-disposition. how can this.
just inject formdatacontentdisposition
also, , file name that.
public response addworkflowschema( @formdataparam("bpmndata") inputstream in, @formdataparam("bpmndata") formdatacontentdisposition fdc) { string filename = fdc.getfilename(); }
the inputstream
content of file part. won't include headers, don't need extract it.
Comments
Post a Comment