sapui5 - Uploading of files using sap.m.UploadCollection in Openui5 with a backend servlet doesn't work -


i have written backend servlet handle upload of files using instantupload feature of sap.m.uploadcollection in openui5. uploading multiple files server, have chosen sap.m.uploadcollection instead of sap.ui.unified.fileuploader. when try parse out list of fileitem instances httpservletrequest in servlet, gives me exception

the request doesn't contain multipart/form-data or multipart/mixed stream

the servletfileupload.ismultipartcontent(request) returning me false , confirms me isn't multipart/form-data request.

xml code:

<uploadcollection id="uploadcollection1"             multiple="true"             samefilenameallowed="true"             showseparators="all"             change="onchangeuploadcollection"             filedeleted="onfiledeleted"             selectionchange="onselectionchange"             uploadcomplete="onuploadcompleteuploadcollection"             beforeuploadstarts="onbeforeuploadstarts"             items="{path : '/record/uploadcollectionitems', templateshareable : 'true'}"             uploadurl="{/record/upload}"             mode="singleselectleft">              <toolbar>                 <overflowtoolbar id="myid1">                     <title id="attachmenttitle1" />                     <toolbarspacer />                     <button id="downloadbutton1" text="download" press="ondownloaditem"                         enabled="false" type="transparent"></button>                 </overflowtoolbar>             </toolbar>             <items>                 <uploadcollectionitem documentid="{documentid}"                     filename="{filename}" mimetype="{mimetype}"                      url="{url}" enableedit="true" enabledelete="true"                     visibledelete="true" visibleedit="true"                     statuses="{path : '/record/uploadcollectionitems', templateshareable : 'true'}"                     selected="false">                     <statuses>                         <objectstatus title="{status}" visible="false"                             state="{state}" icon="{icon}" icondensityaware="{icondensityaware}"                         textdirection="{textdirection}" />                     </statuses>                 </uploadcollectionitem>             </items> </uploadcollection> 

the uploadurl in xml points servlet, starts executing after selection of file done on front-end.

if choose use fileuploader instead of uploadcollection, encodes request multipart/form-data, not fulfill requirements.

i have tried adding content-typeas headerparameter , setting multipart/form-data, in order make request multipart/form-data. since such step not advisable, have aborted mid-way.

since sap.m.uploadcollection control uses sap.ui.unified.fileuploader control , contains dependencies control, confusing why former not send httpservletrequest multipart/form-data.

note: have not included corresponding javascript code or servlet code brevity purposes. i'll happy include them if required.

if take closer code you'll see fileuploader used uploadcollection instantiated usemultipart set false. not have chance change unless intervene creation of fileuploader. i'm not sure why approach has been taken.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -