How to use captured media in an AskiaFace interview
With AskiaFace for iOS/Android, you can capture multimedia files (images, sounds, videos) during an interview.
These files can be then be re-used in the same interview to show or review the media files that have been previously captured.
> Using interview storage
With this storage type captured multimedia files are coded in Base64 and stored in the interview file (XML file).
- Create an open-ended question to capture an image inside the interview file.
- Create a new hidden open-ended question.
- Add a setvalue routing targeting the hidden open-ended question and specify the following value:
dim shortenImgPath = Image.value
shortenImgPath.SubString(5,shortenImgPath.Length) - Create a new question / chapter and add the below syntax into a label:
<img src="data:image/jpg;base64,{%:= ImgPath.Value%} " width="10%" height="10%">
> Using Amazon cloud
Please refer to the below article to setup the Amazon S3 bucket:
https://support.askia.com/hc/en-us/articles/211425449-Save-photos-to-Amazon-S3
When using this storage method, media files are stored locally on the device in the survey working directory.
They are sent later on to AWS, when syncing the app.
- Create an open-ended question to capture the image using Amazon cloud.
- Create a new hidden open-ended question.
- Add a setvalue routing targeting the hidden open-ended question and specify the following value:
dim full = photo.value
dim short = full.split(" ")[3]
return shortThis routing is needed to remove unnecessary characters into the media-capture path.
Original link:
lurl:Path = "/var/mobile/Containers/Data/Application/F2F6C1B1-B155-4AED-9665-839CEC0A0AE6/Documents/demo/258/media2_4E9D88E1-9177-4F45-AC9B-150AB911533D.jpg" Pos = "2" Pwd = "[Amazon S3 password]" Type = "1" User = "[Amazon S3 Login]"
Short link:
"/var/mobile/Containers/Data/Application/F2F6C1B1-B155-4AED-9665-839CEC0A0AE6/Documents/demo/258/media2_4E9D88E1-9177-4F45-AC9B-150AB911533D.jpg"
- Create a new question / chapter and add the below syntax into a label:
<img src="??imagepath??" width="80%" />
>