there is a function available for this:
==========
Code:
DownloadFile("","","")
the parameters are as follow:
1. url: the url where you want to download from
2. FileName: the path and file name where you want to store the file
3. FunctionName: the function which should be run after the download completed (you can use this to use the downloaded file), you must fill this parameter with a function name to function work
==========
the FunctionName that will be called after download completed
will have these parameters:
Code:
function dlCompleteExample(p1,p2,p3)
p1: will indicate that the download is succeeded (true) or failed (false)
p2: will store the path to the file
p3: will get the size of the file
Notes:
1. you can use your own FunctionName
2. you can use your own parameter names as variable instead of p1,p2,p3
3. using of parameters is optional
==============
example:
Code:
function widgetOnLoad()
{
DownloadFile("http://bbs.xwidget.com/styles/subsilver2/imageset/site_logo.gif",WidgetPath+"download_test.gif","dlComplete")
}
function dlComplete(stat,fpath,fsize)
{
print("status: "+stat)
print("file path: "+fpath)
print("file size: "+fsize)
}
================
more info can be found here:
http://bbs.xwidget.com/viewtopic.php?f=8&t=1966http://bbs.xwidget.com/viewtopic.php?f=8&t=3632================