I'm getting a weird error.
Trying to download an mp3 file using createHTTPClient.
The file downloads fully, and at the very end gives the Network connection was lost error.
If i download the same file using a regular browser, the file downloads and has the same file size as the one downloaded with the createHTTPClient.
Anyone have any idea what can be causing this?
var c = Titanium.Network.createHTTPClient({enableKeepAlive:false}); c.setTimeout(10000); c.ondatastream = function(e){ Ti.API.info(e.progress) }; c.onerror = function(e){ Ti.UI.createAlertDialog({title:'XHR', message:'Error: ' + e.error}).show(); }; c.open('GET','http://asd123:r2d2@http://178.62.197.233/dl/110/ac33f71d7db3c3a0fdb80d90dbc95c7a15c6281f4e32a123c948c7467e421b28/128/'); c.file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'myfile.mp3'); c.onload = function(e){ Ti.API.info('Loaded!...') }; c.send();