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
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hello! Please share your project with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a
My app GoldBelt is already shared. Test code is on DataSynch page, btn Test File Download.
Thank you! We'll take a look.
Sorry, there is no GoldBelt app in our list. Is GoldBelt correct name of app?
Name is Gold Belt Tour
ok, thanks
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.
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!
Ok, so I've tested on another Android device and the download finally worked.
I'm testing on 2 Motorola Droid phones
Model: DROID4, v. 4.1.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.
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.