XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 6:25 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Help "Downloading image"
PostPosted: May 27th, 2014, 4:23 pm 
Offline
User avatar

Joined: December 18th, 2012, 12:23 am
Posts: 74
hey, im trying to make a daylight map widget, how do i pharse and automatically download an image (jpg, bmp, gif) to a destination folder?

_________________
"If it's true that our species is alone in the Universe then i'd have to say the Universe aimed rather low.. and settled for very little"
-George Carlin


Top
 Profile  
 
PostPosted: May 27th, 2014, 10:36 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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=1966
http://bbs.xwidget.com/viewtopic.php?f=8&t=3632

================


Top
 Profile  
 
PostPosted: May 28th, 2014, 12:43 am 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Great reply hamid :mrgreen:


Top
 Profile  
 
PostPosted: May 28th, 2014, 6:54 am 
Offline
User avatar

Joined: December 18th, 2012, 12:23 am
Posts: 74
Thank you hamid! :D

_________________
"If it's true that our species is alone in the Universe then i'd have to say the Universe aimed rather low.. and settled for very little"
-George Carlin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group