Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

download a file from a server

$
0
0

Hi i need download a apk file from a server, I guess being the dispositvo downloaded this file ask me (if you want to install the app). Somehow I think if you can do, but I can not find the result.

This is the following code

var xhr = Titanium.Network.createHTTPClient({
                    onload: function() {
                        // first, grab a "handle" to the file where you'll store the downloaded data
                        var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'app.apk');
                        f.write(this.responseData); // write to the file
                        Ti.App.fireEvent('graphic_downloaded', {filepath:f.nativePath});
                    },
 
                });
                xhr.open('GET','http://file');
                xhr.send();
Also try to do it with a webView.url.data ..... but only would have the webView but did nothing.

Can you help me solve this problem please

thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>