How is your experience with the OutSystems Community?
17
Views
8
Comments
Solved
How to download an S3 file directly to Photos/Gallery on Android and iOS?

Hi everyone,

I’m working on an OutSystems ODC Mobile app and need some advice regarding downloading files from AWS S3 to the device.

Our current flow is:

S3 → Presigned URL → ODC Mobile App → Download file

The requirement is to save the downloaded file directly into the device's Photos/Gallery, for both Android and iOS.

For example:

  • .video/img → Android Gallery / iOS Photos

Currently, we can download/access the file using the S3 presigned URL using File Transfer Plugin and it stored the file in Internal Storage.

2026-01-18 14-14-39
Alexander Ng
Solution

Hi everyone,

I have successfully created the @capacitor-community/media plugin and combined it with @capacitor/filesystem to build a solution that can save files to the Photos/Gallery on the device.

Solution:

  • Each plugin should be wrapped in a separate Mobile Library. I tried combining them in an array, but it looks like that didn't work.
  • Publish and release each Mobile Library after creating it.
  • In your mobile app, reference these Mobile Libraries, then publish and regenerate the mobile app.

Thank you for your support!

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Alexander Ng ,

You can try implementing this plugin: capacitor-community/media .


2026-01-18 14-14-39
Alexander Ng

Hi @Mihai Melencu , 

I was trying to use it with this configuration, but after regenerating the packages, the media plugin was not found. I’m not sure what the issue was. Could you point out what might be wrong, or perhaps provide a sample OML? That would be very helpful.

Thank you.

{

    "client": {

        "plugin": [

            {

                "url": "@capacitor/filesystem"

            },

            {

                "url": "@capacitor-community/media"

            }

        ],

        "config": {

            "ios": {

                "Privacy - Photo Library Additions Usage Description": "for saving img to gallery or photos"

            },

            "android": {

                "manifest": {

                    "uses-permission": [

                        {

                            "name": "android.permission.WRITE_EXTERNAL_STORAGE"

                        },

                        {

                            "name": "android.permission.READ_EXTERNAL_STORAGE"

                        }

                    ]

                }

            }

        }

    }

}

or this config 


{    "buildConfigurations": {

        "capacitor": {

            "source": { 

               "npm": ["@capacitor/filesystem@6.0.0", "@capacitor-community/media@6.0.0"]            }        

}    

},   

 "pluginConfigurations": {

        "permissions": {

            "ios": {

                "NSPhotoLibraryAddUsageDescription": {  "description": "saving file to photos or gallery"              

  }            

},           

 "android": [

  "android.permission.WRITE_EXTERNAL_STORAGE",     "android.permission.READ_EXTERNAL_STORAGE"

            ]      

 }    }}

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Alexander Ng ,

I think the primary issue is the plugin version. The current version of the Media plugin is 9.1.0, while your configuration uses 6.0.0. Removing the version from the configuration will make it resolve the latest release.

I also believe the second configuration, using buildConfigurations, is the correct format for ODC.

You can follow this guide on How to Build Capacitor Plugins in OutSystems ODC for more information.

2026-01-18 14-14-39
Alexander Ng

Hi @Mihai Melencu , I tried to update as you mentioned but still got same issue.


2026-01-18 14-14-39
Alexander Ng

hi @Mihai Melencu , I got the issue when I tried to put the config inside the mobile app and it didnt work. I have to move it to mobile lib. Thank you for your support.

2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @Alexander Ng 

I think you can try the Capacitor Downloader plugin by Capgo. It supports Capacitor and provides native download functionality for Android and iOS. 

I’m also exploring how we can integrate this approach with OutSystems ODC.

You can use this OutSystems documentation to create a Capacitor plugin and integrate the required functionality:

Integrate a Capacitor Plugin into a Mobile App – OutSystems

2026-01-18 14-14-39
Alexander Ng

hi @Gourav Shrivastava , you I will try on that one also. Thank you.

2026-01-18 14-14-39
Alexander Ng
Solution

Hi everyone,

I have successfully created the @capacitor-community/media plugin and combined it with @capacitor/filesystem to build a solution that can save files to the Photos/Gallery on the device.

Solution:

  • Each plugin should be wrapped in a separate Mobile Library. I tried combining them in an array, but it looks like that didn't work.
  • Publish and release each Mobile Library after creating it.
  • In your mobile app, reference these Mobile Libraries, then publish and regenerate the mobile app.

Thank you for your support!

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