cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with upload of taken photo with Cordova camera plug-in

0 Kudos

Dear all,

I am working on a mobile FIORI App for posting goods issues in the warehouse. One part of the app is the functionality to take pictures with the camera of the Android device and to save this picture afterwards to SAP backend via OData Service. My problem is that I do not know how to get the picture from the android device to SAP backend. Please let me give you more details on the problem:

  • The app has a button for taking photos. When I click the button, the camera opens and I can take a picture.
    (I solved this with the Cordova camera plug-in https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html)
    The plug-in then returns a file-URL which I can process in my Fiori App. But at this point I do not know what to do with this file-URL. I tried some approaches but none of them worked. Nothing arrived in SAP Backend.
  • To also be able to test the photo upload when I run the App in Chrome Browser on a Desktop PC, I implemented a file uploader where I can select images from the hard drive. (https://sapui5.hana.ondemand.com/#/api/sap.ui.unified.FileUploader)
    Then I just start the upload with the Upload Button and my picture is uploaded to SAP Backend.
    This is the proof that the backend service works correctly. The create_stream method works fine so far. I just mention this to make clear, that the problem is not the backend (Solution is quite the same as in this link: https://blogs.sap.com/2016/11/08/step-by-step-on-how-to-use-the-sapui5-file-upload-feature/)

Tu summarize, upload from desktop PC via file uploader works fine, but I found no solution how to get the photo from a mobile android device to SAP backend. I really hope somebody could give me a hint to the solution or some piece of code which works for my app.

Thanks in advance for your help.

Regards,

Chris

Accepted Solutions (0)

Answers (0)