cancel
Showing results for 
Search instead for 
Did you mean: 

Upload an image using SAP BTP iOS SDK

sharma_pawan
Discoverer
0 Kudos
774

I want to develop an app using SAP BTP iOS SDK to capture images from the iOS device(iPhone & iPad) camera. I know how to setup SAP BTP SDK using Assistant and use the camera API to capture images from iOS device.

I could not find any reference or sample code on how to upload the captured image to SAP BTP content server.

I found this to add attachment to a cell here:

https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/3.0/en-US/Documents/Frameworks/SAPFiori/Cl...

Any sample code or reference to document will help.

Accepted Solutions (1)

Accepted Solutions (1)

AlexGiguere
Contributor
0 Kudos
let byteStream = ByteStream.fromBinary(data: imageData)
byteStream.mediaType = "image/jpg"
byteStream.fileName = fileName
requestHeaders.setHeader(withName: "Slug", value: fileName)

try? service.createRelatedMedia ....

you should have a media entity type, you first create your entity, then you call createMedia or createRelatedMedia

sharma_pawan
Discoverer
0 Kudos

Thanks alexandregiguere, I'll try this solution.

Answers (0)