Board index » Visual Studio » Copy file from specific https url to local drive

Copy file from specific https url to local drive

Visual Studio342
Hi,



Not sure if i got the right forum, i want to do this with a vbs file

anyways, or dos cmd.



I have a specific https url that points to a .xls file:



ie. https://url/test.xls



When i enter the url into a web browser, i firstly get the 'single sign on'

authentication box (entering my username and password for https access) and

then i get a save dialog box where i can save the file.



I want to automate this using the easiest method possible. I dont know where

to look, what would be the best approach?



Thanks heaps,



Josh


-
 

Re:Copy file from specific https url to local drive

I was thinking that using the internet explorer DOM would be suitable, but

does this support https? And would this be the best approach?



"Joshua Weir" wrote:



Quote
Hi,



Not sure if i got the right forum, i want to do this with a vbs file

anyways, or dos cmd.



I have a specific https url that points to a .xls file:



ie. https://url/test.xls



When i enter the url into a web browser, i firstly get the 'single sign on'

authentication box (entering my username and password for https access) and

then i get a save dialog box where i can save the file.



I want to automate this using the easiest method possible. I dont know where

to look, what would be the best approach?



Thanks heaps,



Josh

-

Re:Copy file from specific https url to local drive

Hi!



Try tu use this example:



function sendData()

{

var User, Password;

var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

User = Submit.UserID.value;

Password = Submit.Psw.value;

oXMLHTTP.open("get", "/web/welcome.asp", false, User, Password);

oXMLHTTP.send("xmlDoc");

window.location.href="/web/welcome.asp"

}



It was taken from microsoft's book and used before for form

authiorization.

May be it helps.



Regards,

Dan



Joshua Weir pretended :

Quote
I was thinking that using the internet explorer DOM would be suitable, but

does this support https? And would this be the best approach?



"Joshua Weir" wrote:



>Hi,

>

>Not sure if i got the right forum, i want to do this with a vbs file

>anyways, or dos cmd.

>

>I have a specific https url that points to a .xls file:

>

>ie. https://url/test.xls

>

>When i enter the url into a web browser, i firstly get the 'single sign on'

>authentication box (entering my username and password for https access) and

>then i get a save dialog box where i can save the file.

>

>I want to automate this using the easiest method possible. I dont know where

>to look, what would be the best approach?

>

>Thanks heaps,

>

>Josh





-

Re:Copy file from specific https url to local drive



"Dan Khanseitov" <dankh(nospam@)mail.ru>wrote in message

Quote
Hi!



Try tu use this example:



function sendData()

{

var User, Password;

var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

User = Submit.UserID.value;

Password = Submit.Psw.value;

oXMLHTTP.open("get", "/web/welcome.asp", false, User, Password);

oXMLHTTP.send("xmlDoc");

window.location.href="/web/welcome.asp"

}



It was taken from microsoft's book and used before for form

authiorization.

May be it helps.



Regards,

Dan



Joshua Weir pretended :

>I was thinking that using the internet explorer DOM would be suitable,

but

>does this support https? And would this be the best approach?

>

>"Joshua Weir" wrote:

>

>>Hi,

>>

>>Not sure if i got the right forum, i want to do this with a vbs file

>>anyways, or dos cmd.

>>

>>I have a specific https url that points to a .xls file:

>>

>>ie. https://url/test.xls

>>

>>When i enter the url into a web browser, i firstly get the 'single sign

on'

>>authentication box (entering my username and password for https access)

and

>>then i get a save dialog box where i can save the file.

>>

>>I want to automate this using the easiest method possible. I dont know

where

>>to look, what would be the best approach?

>>

>>Thanks heaps,

>>

>>Josh





If the file you want is binary or an image use the ADO stream object



set oHTTP = CreateObject("Microsoft.XMLHTT­P")

set oStream = createobject("adodb.stream")

oStream.type = 1

oHTTP.open "GET", sSource, False

oHTTP.send

oStream.open

oStream.write oHTTP.responseBody

oStream.savetofile sDest





-