Download File by WebView

715 views
Skip to first unread message

Devy1

unread,
Sep 4, 2016, 11:54:03 AM9/4/16
to MIT App Inventor Forum
Hello guys,
I have a problem with the Web component.... I'm creating an app with a webviewer that show my website, but when i want to download a file from the website, it doesn't work... I read on the forum that it needs the Web component but i don't know how to use it. I tried to follow the tutorial on https://puravidaapps.com/filedownload.php but it works only if you press a button created with app inventor.... I need that when i touch the button "download" of the website, it downloads the file on my device.... How can i do it?
Thanks at all.

Taifun

unread,
Sep 4, 2016, 3:32:38 PM9/4/16
to MIT App Inventor Forum
the webviewer can't download images

but for your own webpage you could use a trick to find out, if the user pressed that button... you will have to add some JavaScript to write some text (for example the text DOWNLOAD) into the title of the webpage after the user pressed that button, you also could set the webviewstring...

then in App Inventor use a clock component and check regularly if the title (or the webviewstring) = DOWNLOAD, then use the web component to download the image

see also some examples here https://puravidaapps.com/tutorials.php#html

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Pierre GALLAND

unread,
Sep 5, 2016, 5:48:48 AM9/5/16
to MIT App Inventor Forum
It's not a problem of button of download touch or not on my website... I can do it directly on app with download button on app and below my form... I send to my form only pictures name like this my form is attached with picture...
My problem is to upload picture form mobile phone to one server who can run PHP and ASP. In this case i don't need specialy to work in ASP if PHP sample is enought to upload pictures.
In my case, i have paste file postfileV2.php and install PHP_Compat-1.6.0a3 directory... Now I can selct picture, see picture name and message "trying to post file please wait" appear and little time after web site page write an error because normaly picture should be read from server but like he has not been uploaded... Error page 502 bad Gateway appear.

Problem is into upload file on server...

Pierre GALLAND

unread,
Sep 5, 2016, 7:29:21 AM9/5/16
to MIT App Inventor Forum

Message error :

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "package2.xml" in C:\myserver\httpdocs\Occasion\fiches_APK\PHP_Compat-1.6.0a3\PHP_Compat-1.6.0a3\package-test.php on line 42

Fatal error: Call to a member function registerXPathNamespace() on a non-object in C:\myserver\httpdocs\Occasion\fiches_APK\PHP_Compat-1.6.0a3\PHP_Compat-1.6.0a3\package-test.php on line 43
Reply all
Reply to author
Forward
0 new messages