15
Views
2
Comments
Download binary file in Mobile App in ODC

Hi everyone,

I’m currently working on a mobile app project using ODC (OutSystems Developer Cloud). After click file name in the UI, I need to download files (jpg, xlsx, etc.) that are returned from a Server Action in binary (base64) format.

I’m using File Transfer Plugin/WriteFile to create a local file and then use the returned URI. Along with that, I use File Viewer Plugin/OpenDocumentFromLocalPath with returned URI to preview the file, where Forge provides options for users to download. Currently working perfectly.

However, I now have a new requirement:

  • I want the file to start downloading immediately when the user clicks the file name

  • I do not want to open the preview screen

What I’ve tried so far:

  • Download Manager Plugin, but it doesn’t seem to work properly on iOS

  • FileTransferPlugin / DownloadFile, but it keeps throwing variable-related errors

Has anyone faced this issue before or knows how to handle this scenario?

Thanks in advance for your help.

2023-10-16 05-50-48
Shingo Lam

You can use js to create a link then click on the link to download the file. Please refer to the js sample below

UserImage.jpg
Alan Nguyen

Hi Shingo, I think JS does not work on mobile application

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.