cancel
Showing results for 
Search instead for 
Did you mean: 

File upload with multipart form data using SAP UI5 upload collection

prasad
Participant
0 Kudos

Hi Team,

I had a requirement to upload a file using upload collection . The File upload uses a REST API which accepts multiform data and CURL operation as below

curl --location --request POST 'https://xx.abc.testworkflow/fileupload/' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: q5c5cb8c-af15-43c3-890-a9d748608k16' \
--form 'Files=@"/C:/Users/admin/Downloads/devDeployConfig.mtaext"' \
--form 'fileStoreTypeMap="{
 \"devDeployConfig.mtaext\": {
 \"fileType\": \"mtaext\",
 \"fileContentType\": \"text/plain\"
 }
}";type=application/json'

Added the header parameters as required in onBefore upload starts . one of the form parameter accepts the content of the file and other parameters accepts the object.

How would i add the add the Form parameters as part of multi form data using Upload collection .

Do i need to use another $.Ajax to post the above operations ?

Regards

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

I039810
Advisor
Advisor

Hi

This is possible by using file uploader internally and set useMultipart = true (more details: API Reference - Demo Kit - SAPUI5 SDK)

Thanks,

Shalini