What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Download a File

Download a File
Author: Message:
leetking
New Member
*


Posts: 10
– / Female / Flag
Joined: Dec 2008
O.P. Download a File
Hello guys,
just wanted to know if there is any way to download a file on the PC with a MSN Script?
06-19-2009 11:12 PM
Profile E-Mail PM Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
RE: Download a File
quote:
Originally posted by leetking
Hello guys,
just wanted to know if there is any way to download a file on the PC with a MSN Script?

Yes there is, you can use the MsgPlus.DownloadFile() function. See the Scripting Documentation for more information :)
06-19-2009 11:50 PM
Profile PM Find Quote Report
leetking
New Member
*


Posts: 10
– / Female / Flag
Joined: Dec 2008
O.P. RE: RE: Download a File
code:
function OnEvent_DownloadFileComplete(Url, OutFile, Success){
    Debug.Trace("Url: " + Url);
    Debug.Trace("OutFile: " + OutFile);
    Debug.Trace("Success: " + Success);
    }

var Url = "http://www.msgpluslive.net/favicon.ico";
MsgPlus.DownloadFile(Url);

This works.

code:
Skript wurde angehalten
Skript wird gestartet
Skript wurde geladen und ist bereit
Aufgerufene Funktion: OnEvent_DownloadFileComplete
Url: http://www.msgpluslive.net/favicon.ico
OutFile: C:\DOKUME~1\Manuel\LOKALE~1\Temp\mpscript_343b.tmp
Success: true


But:
code:
var Url = "http://www.msgpluslive.net/favicon.ico";
var OutFile = "C:\\ ";
MsgPlus.DownloadFile(Url, OutFile);

doesnt work:
code:
Skript wird gestartet
Skript wurde geladen und ist bereit
Aufgerufene Funktion: OnEvent_DownloadFileComplete
Url: http://www.msgpluslive.net/favicon.ico
OutFile: C:\
Success: false
06-20-2009 12:50 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Download a File
That's because "OutFile" has to be a file path, not only a folder path. So you should change that to something like:
js code:
var Url = "http://www.msgpluslive.net/favicon.ico";
var OutFile = "C:\\favicon.ico";
MsgPlus.DownloadFile(Url, OutFile);
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-20-2009 12:55 PM
Profile E-Mail PM Web Find Quote Report
leetking
New Member
*


Posts: 10
– / Female / Flag
Joined: Dec 2008
O.P. RE: RE: Download a File
quote:
Originally posted by Matti
That's because "OutFile" has to be a file path, not only a folder path. So you should change that to something like:
js code:
var Url = "http://www.msgpluslive.net/favicon.ico";
var OutFile = "C:\\favicon.ico";
MsgPlus.DownloadFile(Url, OutFile);



Woot :) thx. It works now!
New Question: Is there a way to find out a path, for example, to the MSN Script ? So it will automatically update itself?
06-20-2009 01:01 PM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Download a File
MsgPlus.ScriptFilesPath

and if you want to make a script auto-update, Messenger Plus! Live can do this if you submit it to the database... I forget where this information is, but if you search the forums or the main website you should be able to find this ;)

edit: shush you Matti 8-)

This post was edited on 06-20-2009 at 01:34 PM by NanaFreak.
06-20-2009 01:11 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Download a File
quote:
Originally posted by NanaFreak
I forget where this information is, but if you search the forums or the main website you should be able to find this ;)
It's right here: Auto-Update for Skins & Scripts FAQ (stickied under MsgPlus! General Talk)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-20-2009 01:18 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On