315
Views
8
Comments
Solved
[File Transfer Plugin] Does File Transfer Plugin works for PWA generated app?
Question
file-transfer-plugin
Mobile icon
Forge asset by OutSystems

Hello,

I wanted to know if PWA generated app can use the File Transfer Plugin. I tried following the file transfer plugin sample app but nothing is downloaded, I also tried set up in the OnReady for the FilePath but I get error message "Cordova not defined".

2016-11-04 00-37-21
Experts
Staff
Solution

Hi Wenchester, 

You can do it by using FileSave js. Here you have a sample on how to download a file in a PWA. Let me know if it works for you.

Thanks!

PWAUtilsSample.oap
UserImage.jpg
you asen

hi
how i can use this .oap file in outsystem please ?

2022-07-11 14-05-36
Jeroen Barnhoorn

Hi Wenchester,

How are you accessing your PWA? Most Cordova plugins will only work on mobile devices. 

2019-08-14 06-23-18
Wenchester

Hi Jeroen,

I install it in my android phone through browser "Add to Home"

2021-01-19 14-07-32
Tom Zhao

Hi Wenchester 

Because File Transfer Plugin supports browser, So I think it will work on PWA.

Can you upload oml file? So we can take a look for more details.

Best Regards


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Wenchester, 

You can inspect the codeof the FileTransfer Plugin by opening the module  in service studio. What you will see is that it uses a Cordova github project and that on every download/upload action it checks for the existence of the cordova plugin and cordova. 

As a PWA does not run in a cordova shell, but directly in the  browser, I believe the plugin cannot be used when installed as a PWA. You can test this out by installing the accompanying demo application as a PWA on your mobile device. You will notice an error message is shown "Cordova is not defined".

Regards,

Daniel

2019-08-14 06-23-18
Wenchester

So if I want to distribute my apps as a PWA and want to have a download feature in my mobile apps, how to do so?

2016-11-04 00-37-21
Experts
Staff
Solution

Hi Wenchester, 

You can do it by using FileSave js. Here you have a sample on how to download a file in a PWA. Let me know if it works for you.

Thanks!

PWAUtilsSample.oap
UserImage.jpg
you asen

hi
how i can use this .oap file in outsystem please ?

UserImage.jpg
Sarah Gillespie

Thank you @Experts for the sample above! It really helped me.

My goal was to export all data from the database in a PWA, I've attached a sample in case anyone else is trying to do the same thing.

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