- Code: Select all
var getlogo=new NKFileDownloader();
getlogo.openURL("http://192.168.0.222/airnewspix/cx.png");
getlogo.start("cx.png");
setTimeout(getlogoProgress, 1000);
function getlogoProgress()
{
var progress = getlogo.getProgress();
if(progress == -1)
{
NKLog("failed");
}
else
{
NKLog("progress="+progress);
if(getlogo.getProgress() < 100)
{
setTimeout(getlogoProgress, 1000)
}
}
}
NKLog("downloaded");
It's almost identical to the example in the NK documentation. But...
What I see _first_ in the log is "downloaded" followed by an infinite stream of "progress=0" messages.
I also get a file in Documents called cx.png, sometimes empty, sometimes not, but never the complete file. The file on the server does exist. If I rename/remove it, I correctly see "failed" in the log.
Tkx in advance...
--paul
