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

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
HTML/CSS/JS desktop application runtime for RHEL6
How can I make offline maps for Windows Desktop Application using Mapbox
Connect Production server sql database from my desktop application
softphone pbx software creation [closed]
How do I correctly ship licenses with my desktop app?

Categories

HOME
optimization
azure-documentdb
oracle-sqldeveloper
abc
skypedeveloper
app-store
bitbucket
swap
schema
restheart
software-collections
digital
fetch
vichuploaderbundle
camunda
react-select
samba
geography
project-reactor
react-jsx
coccinelle
ng-tags-input
bootstrap-accordion
ps
my.cnf
windows-mobile
emr
jbossfuse
lines
luhn
jsonapi-resources
mootools
odp.net
geocomplete
perf
anypoint-studio
framebuffer
rexx
yank
opos
spring-cloud-bus
cloudconvert
extjs3
aws-rds
htop
fileopendialog
directinput
scriptengine
change-password
patching
avaudiorecorder
user-profile
abstract
bioconductor
jcomponent
traminer
vensim
system.diagnostics
drools-guvnor
unityvs
ios-enterprise
msdropdown
visual-c#-express-2010
xps
iwork
flask-mongoengine
.net-reflector
xtify
mysql-error-1146
randomaccessfile
dynamic-expresso
infinity.js
azure-scheduler
coinbase-php
codeigniter-form-helper
spawn
nx
brew
setcookie
dnsbl
quit
correctness
linear-interpolation
blackberry-eclipse-plugin
facebook-winjs-sdk
wdm
recess
jexcelapi
auto-compile
cinder
text-manipulation
uccapi
dgml
ihtmldocument2

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