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:
Currently, we can download/access the file using the S3 presigned URL using File Transfer Plugin and it stored the file in Internal Storage.
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:
Thank you for your support!
Hi @Alexander Ng ,
You can try implementing this plugin: capacitor-community/media .
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": {
"NSPhotoLibraryAddUsageDescription": { "description": "saving file to photos or gallery"
"android": [
"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"
} }}
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.
Hi @Mihai Melencu , I tried to update as you mentioned but still got same issue.
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.
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
hi @Gourav Shrivastava , you I will try on that one also. Thank you.