desktop-application


TideSDK: Download mp3 files


I am trying to download an mp3 file from a server but the app crashes. The file gets created, gets some data in the file and then a crash. Here is what i am trying:
var file = Ti.Filesystem.getFile(directory.nativePath(), filename);
var httpClient = Ti.Network.createHTTPClient();
httpClient.open('GET', URL);
httpClient.receive(function(data) {
var fileStream = Ti.Filesystem.getFileStream(file);
fileStream.open(Ti.Filesystem.MODE_WRITE, true);
fileStream.write(data);
fileStream.close();
});
thanks.
This works:
var file = Ti.Filesystem.getFile(directoryPath, filename);
var httpClient = Ti.Network.createHTTPClient();
httpClient.onload = function(e) {
file.open(Ti.Filesystem.MODE_WRITE);
file.write(this.responseData); // write to the file
}
httpClient.open('GET', URL);
httpClient.send();

Related Links

Creating a WYSIWYG editor for maths expressions
Product design at a startup - asking for advice [closed]
Rich HTML tray menu in a desktop web application
Does electron.io have access to run git commands?
Collecting Customer Satisfaction over time
Name Mapping dynamic objects for desktop app
Compliance testing for desktop applications
Count the number of filtered values
electron makeSingleInstance not restoring app
Electron autoUpdater: User initiated download on 'update-available'
Why i run xcompmgr,window can't be placed at the top。
While setting up Windows 10 Standard user in assigned acces mode, unable to see app for field (Choose which app this account can access)
How to package a node webkit app as a hybrid standalone desktop app
How to register a desktop application (app) for Windows Error Reporting (WER)
Kivy to create a Desktop program?
My app passed windows app certification test with warnings,will I be able to publish it on the windows store

Categories

HOME
oauth-2.0
drupal
joomla
autohotkey
stata
teradata
wifi
apache-storm
ibm
okhttp3
azure-resource-manager
gnuradio
collision-detection
handlebars.js
clip-path
google-api-oauth
ejb-3.0
facebook-sharer
oxid
cakephp-2.0
fastreport
appsettings
taxonomy
powerpivot
novacode-docx
caldav
android-navigation-drawer
wai-aria
concatenation
prepros
scalatest
nsopenpanel
orgchart
federated
edirectory
boost-log
availability
android-scrollview
matlab-compiler
incapsula
wunderground
cache-control
abide
form-fields
libconfig
nscollectionview
pexpect
python-venv
bootstrap-carousel
django-cors-headers
anonymous-function
hdpi
visio-2010
sharpdevelop
fckeditor
opticalflow
multi-targeting
recursive-query
therubyracer
sqlproj
firebase-job-dispatcher
boost-range
cosign-api
vga
supervised-learning
boost-bind
nugetgallery
code-translation
matlab-engine
ruby-1.8.7
mojolicious
webservices-client
serial-communication
persian
syncano
polarion
google-experiments
drools-guvnor
report-builder2.0
os.walk
gnip
indic
triplestore
mvcgrid
email-headers
elixir-framework
git-subtree
acrofields
android-jack-and-jill
nativequery
autofilter
imaplib
google-voice
kendo-window
nx
architectural-patterns
blotter
metapost
feincms
winrt-async
systrace
commonsware
stl-algorithm
cinder
llblgen
mediastreamsource
versions
large-data-volumes
lts
morfik
file-storage
rpxnow
jettison
j++

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App