Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to download a file using javascript

Hello! Please share your project with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

How to download a file using javascript

My app GoldBelt is already shared. Test code is on DataSynch page, btn Test File Download.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to download a file using javascript

Thank you! We'll take a look.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to download a file using javascript

Sorry, there is no GoldBelt app in our list. Is GoldBelt correct name of app?

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

How to download a file using javascript

Name is Gold Belt Tour

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to download a file using javascript

ok, thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to download a file using javascript

We tested this app on Android 4.0.4 - it works. There is a CONNECTION_ERR and you would need to check Internet connection on your device.
Another way - on DataSynch page add Image component with the following name imageName and on page Show event run the following code:
preAppery('imageName').attr('src', 'http://www.goldbeltbyway.com/sites/default/files/uploads/shelf1.jpg');/pre
Check is there image shown.

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

How to download a file using javascript

Thanks Marina. I'm thinking it's specific to my Android device. It seems to be working OK on iOS:

Testing with Appery Test App iOS simulator:
-- your above image code works, displays image
-- Gold Belt app file download gives me different error (code 1), saying it can't find target file path... which seems to me it's working and simply cannot find 'sdkcard' path while running simulator

I will test out image on Android shortly and let you know. Thanks for your help!

Helen
Posts: 0
Joined: Wed Aug 28, 2013 8:35 pm

How to download a file using javascript

Ok, so I've tested on another Android device and the download finally worked.
I'm testing on 2 Motorola Droid phones

  1. Model: DROID4, v. 4.1.2

  2. Droid Bionic, v. 4.1.2

    When testing using
    Appery Test App -- neither work (Connection Error Code 3)
    Installed .apk on device -- ONLY device #1 worked

    I haven't tested by installing on iOS device since I can't yet compile Test App nor my own app.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to download a file using javascript

Hi Helen,

Appery.io Test App is not a reliable environment for testing the native app functionality (not the standard for browser). It's better to build binary application and install it.

Unfortunately, we can not test this on the Droid Bionic.

Return to “Issues”