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

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
HTML/CSS/JS desktop application runtime for RHEL6

Categories

HOME
optimization
stanford-nlp
customization
aix
dynamic
livecharts
spotfire
uml-designer
swap
comments
sitemap
genexus
pyodbc
box-api
angularjs-ng-repeat
fetch
aspectj
multibinding
game-engine
smooth-scrolling
vivado-hls
google-calendar-api3
url-parameters
webgl-earth
connectiq
tcpdf
google-drive-android-api
pushbullet
core-animation
scalatest
boosting
dynamic-memory-allocation
uibarbuttonitem
pushpad
undo
selenium3
intermec
jsonapi-resources
imageprocessor
webmock
n1ql
javax
ragel
javafxports
motherboard
kdevelop
device-driver
instances
office-interop
server-side-swift
uitextview
wufoo
inner-join
encoder
google-chrome-storage
lucee
noise
e4
dynamic-linking
gige-sdk
openpgp.js
seyren
multi-select
robotc
suitesparse
recursive-query
google-scholar
breadcrumbs
spring-social-twitter
portaudio
papyrus
init
nimbus
android-progressbar
containstable
opendolphin
overlapping
taverna
cyberduck
avrcp
sparkcore
tinymce-plugins
screen-lock
jad
mathics
quickfixn
nsnotificationcenter
xpand
farpoint-spread
object-oriented-database
kuka-krl
node-amqp
netbeans-plugins
thucydides
code-complete
google-mirror-api
randomaccessfile
dylan
angularjs-select2
mandelbrot
pyxplot
azure-scheduler
uikit-dynamics
proj4
http-compression
cocotron
qt5.1
rfc822
custom-cursor
xcode4.6.3
waveout
winrt-async
github-archive
diazo
scsf
cherokee
backlight
zipstream
response-time
xcdatamodel
dgml
scala-designer
httpbrowsercapabilities

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