App Inventor and the Web component


File Download with App Inventor

This simple example shows how to download a file from the internet to your device.
You also might be interested in the Webprefetch solution of Shival Wolf and the Webprefetch File by File solution.

App Inventor Blocks


Screenshot


File Download from a Restricted Area

This example shows how to download a file from a password protected area to your device. I prepared this webpage http://restricted.puravidaapps.com using basic HTTP authentication, which means, you can access this area only after login with username and password. Try it with username=appinventor and password=appinventor. To be able to do the authentication with App Inventor, we have to add an Authentication header.

The Authorization header is constructed as follows (source: Wikipedia):

To make it as simple as possible, I just Base64 encoded the username:password string appinventor:appinventor using this page which results in YXBwaW52ZW50b3I6YXBwaW52ZW50b3I= and put that hardcoded into the header. That's all.

App Inventor Blocks


Do you need help with your App Inventor project?

I can help you: for one hour I charge 25$.
Please contact me at info [at] puravidaapps [dot] com for details!
For questions about App Inventor, please use the App Inventor forum. Thank you.

Screenshot

Download


If you find this example helpful and you are using it in one of your projects,
be nice and donate a small amount!

Thank you! Taifun
 

File Download example
Download zip file for App Inventor

File Download from Restricted Area example
Download zip file for App Inventor

Back to top of page ...

Creative Commons License
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.


Home | Apps | Snippets | Tutorials | News | Forums | Links | Search | Contact