How to upload image or video recordings to simplier content repo
-
Christopher Steinbach1 year ago #36640
Hi Simplifier,
I want to capture a photo with a mobile action and upload it to the content repo plugin.
I did content repo uploads before as described in this tutorial: https://community.simplifier.io/knowledge/how-to-use-simplifier-content-repository-plugin/
But the mobile action shapes “Capture Image” and “Capture Video” do not output a blob which can be uploaded by Simplifier’s uploader (used in the tutorial).
There is a mobile action “Upload File”, but this shape is quite generic. I tried to configure it to work like the “Util.Uploader” but without success so far.
Do I have to use a file reader with cordova’s “window.resolveLocalFileSystemURL” or is there a Low-Code approach to solve that.
How to upload media files captured with a mobile action to the Simplifier content repo?
Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification1 year ago #36694::Hi Mr Steinbach,
To upload an image taken on the mobile client, you can use the following sequence (see attachment):
- Capture the image with the mobile action
- Use the Client-Side BO ‘SIMP_FileHelper’ – ‘readFileByUrl’
- Use the Client-Side BO ‘ITIZ_Utilities’ – ‘UploadFile’ to get a session key for the ContentRepo upload
- OR you can directly use the Base64 string from ‘readFileByUrl’ for the upload
Regarding your second comment, I will give you an answer as soon as I talked to my colleagues in mobile development.
Attachments:
You must be logged in to view attached files.Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification1 year ago #36704::The CSBO ‘SIMP_FileHelper’ is part of the Standard Content that is available on our Marketplace: https://community.simplifier.io/marketplace/
We are currently working on re-structuring the Business Objects for the Standard Content, so the functions won’t be cluttered inside ‘ITIZ_Utilities’ anymore. But I cannot estimate when the changes will be made public.
In the mobile actions, you can set a limit in the panel on the right, to define how many photos/videos/audios the user is able to capture. For feature requests, feel free to post your idea on our new feature request board: https://ideas.simplifier.io/ideas
Regarding the cordova plugins: we are using the plugin ‘media-capture’ because with this plugin, we can cover the use cases to capture pictures, videos and audio at the same time, which makes code maintenance easier. The camera plugin does not cover capturing audio.
We are using the following cordova versions: cordova-ios: 6.2.0, cordova-android: 10.1.2, cordova-CLI: 11.0.0.
I hope this helps!
Christopher Steinbach1 year ago #36648::I found this list of Cordova plugins: https://community.simplifier.io/doc/current-release/deploy/simplifier-mobile-client/features-and-supported-operating-systems/
And checked how Simplifier is taking the photo. You’re using “navigator.device.capture.captureImage” from the “cordova-plugin-media-capture” plugin. This plugin enables photo, video and audio capturing. But it can only write to the local device file system. This causes another problem: The photos will also show up in the users device photo album and will stay there forever. This shouldn’t be the default behaviour of a business application.
Why is is Simplifier not using “cordova-plugin-camera” instead. This plugin gives you more control and other useful options, like picture quality, media type, target width and height, “save to photo album” or “destination type”. The plugin also has a cleanup function to remove the intermediate image files. The plugin can output the captured image as base64 or file uri.
What Cordova version is Simplifier using?
Christopher Steinbach1 year ago #36700::Thank you for your reply Jennifer. Where can I download SIMP_FileHelper? I searched on the marketplace but can’t find it there.
Meanwhile I have developed my own BO to handle mobile photo and video content including the camera action. The API provided by Simplifier’s utility BO’s seems to be quite inconsistent. Why do I need to different BO’s to upload a photo in the first place? Why is this not a function included in the process designer?
I also experienced an error of the capture photo action if the user closes the camera app without taking a photo. I’m not sure if that should be the case.
Also, the included capture photo shape seems to support only one photo at the time.
You must be logged in to reply to this topic.