What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Question] Download zip file

[Question] Download zip file
Author: Message:
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. [Question] Download zip file
How can I download a zip file from the internet using code?

I don't want WScript.Shell.run function downloading it for me, maybe any kind of ActiveX object.

Thanks
02-01-2007 01:20 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [Question] Download zip file
code:
function DonwloadFile(URL, LocalFile){
    var fso = new ActiveXObject('Scripting.FileSystemObject');
    LocalFile = fso.BuiltPath(LocalFile);
    return Interop.Call('urlmon', 'URLDownloadToFileW', 0, URL, LocalFile, 0, 0);
}
This might freeze WLM while downloading.

This post was edited on 02-01-2007 at 02:42 PM by Felu.
02-01-2007 01:33 PM
Profile E-Mail PM Web Find Quote Report
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. RE: [Question] Download zip file
quote:
Originally posted by Felu
code:
function DonwloadFile(URL, LocalFile){
    var FSO = new ActiveXObject('Scripting.FileSystemObject');
    var LocalFile = fso.BuiltPath(LocalFile);
    return Interop.Call('urlmon', 'URLDownloadToFileW', 0, URL, LocalFile, 0, 0);
}


What am I supposed to put on LocalFile? Path to the new file downloaded?

This post was edited on 02-01-2007 at 01:56 PM by tryxter.
02-01-2007 01:55 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [Question] Download zip file
quote:
Originally posted by tryxter
What am I supposed to put on LocalFile? Path to the new file downloaded?

Yes [Image: msn_wink.gif].
02-01-2007 02:00 PM
Profile E-Mail PM Web Find Quote Report
tryxter
Junior Member
**

Avatar
A. Maia Ferreira @ PTnet

Posts: 51
Reputation: 1
35 / Male / –
Joined: Jan 2007
O.P. RE: [Question] Download zip file
Works perfect. Thanks one more time!
02-01-2007 02:02 PM
Profile E-Mail PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
RE: [Question] Download zip file
Download Files Using IE's Download Dialog   :P


code:
//Example:
Interop.Call("shdocvw", "DoFileDownload", "http://felipex.net/scripts/styles122.plsc");   

02-01-2007 10:30 PM
Profile E-Mail PM 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