Sign in to follow this  
Followers 0
RichyOz

How to download a file using https, without launching Firefox

14 posts in this topic

Hi guys,

i am new to AutoIT, but really enjoying it. For my work, i have to download a few files quite regularly using Firefox. I have been told at work that IE won't let you download the files in the correct format, so Firefox must be used. I have written a script to open Firefox, put in the URL addresses and download the files through mouse clicking procedures, however, i find it a bit 'messy'. Is there any way for me to download files using the https command, without having to launch any browser? The files are Adobe extension panels for a video editing software, which are in .zxp format. IE won't let you download in zxp format. Also, you need certificates installed on your web browser (IE or Firefox) to download the files, which i have. Thanks.

Cheers,

Rich.

Share this post


Link to post
Share on other sites



I'm sure its possible to make IE download zxp files, instead of (assuming) displaying them as text.

For downloading from within AutoIt see the InetGet() and other Inet* related commands.

To get started also Search the forum for some example scripts. Starting with "Title" search recommended for that.

(Don't know about certificates in relation to downloading with AutoIt. But I don't think they play a role there.)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Thanks for the reply MvGulik,

i just realised that IE will allow you to download the file, but it simply changes the extension from .zxp to zip. You just have to change the extension back to .zxp once it's downloaded, which i can easily do in AutoIT. I'll try the commands you mentioned later on today. I'm hoping there is some command available in AutoIT that will simply download the file without opening IE. Thanks.

Cheers,

Rich.

Share this post


Link to post
Share on other sites

I'm hoping there is some command available in AutoIT that will simply download the file without opening IE.

Yes there is. That would be the

For downloading from within AutoIt see the InetGet() and other Inet* related commands.

part.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Hi guys,

i have tried to use the InetGet and InetRead commands to download my required files, but have had little success. I am using the following command to try and download the file:

Local $sData = InetGet("https://......../Panel.zxp", "C:" & "\AdobePanel.zxp",0,0)

But the handle returns 0 and nothing is downloaded. You HAVE to have a special certificate installed in IE to download the files, which i do. If i put the URL into the IE URL address, it downloads the file fine. Does InetGet work with certificates?

Thanks.

Share this post


Link to post
Share on other sites

search titles for "winhttp"

WinHTTP would be rather useless when dealing with the HTTPS protocol.

I would recommend viewing the Inet commands.

Share this post


Link to post
Share on other sites

WinHTTP would be rather useless when dealing with the HTTPS protocol.

I would recommend viewing the Inet commands.

Spoken like someone that knows what they are talking about ( however wrong they may be ).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Spoken like someone that knows what they are talking about ( however wrong they may be ).

Oh, thanks for the heads up.

The default winhttp functions / $oHTTP actually doesn't support the HTTPS Protocol.

If you're referring to trancexx's UDF I honestly haven't tried it yet.

Edit: SmOke_N, are you sure about your previous statement? I just tried using winhttp (default instance) to handle a request from the HTTPS Protocol, nothing happened but a terminal error. I'd really like to confirm this. Not for argument-related reasons, pretty much just to verify things. Beneficial wise.

Edited by Kalin

Share this post


Link to post
Share on other sites

Hi.

from the documentation:

InetGet

--------------------------------------------------------------------------------

Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.

InetGet ( "URL" [,"filename" [, options [, background]]] )

Parameters

...

options [optional] 0 = (default) Get the file from local cache if available.

...

2 = Ignore all SSL errors (with HTTPS connections).

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

That's exactly what I recommended before SmOke_N tried to correct me...

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hi Guys,

thanks for the replies. I have tried all the optional parameters in 'InetGet', but nothing seems to work. Might have to call it quits with this one, or might have to resort to visual basic.

Cheers anyway.

Edited by RichyOz

Share this post


Link to post
Share on other sites

Oh, thanks for the heads up.

The default winhttp functions / $oHTTP actually doesn't support the HTTPS Protocol.

If you're referring to trancexx's UDF I honestly haven't tried it yet.

Edit: SmOke_N, are you sure about your previous statement? I just tried using winhttp (default instance) to handle a request from the HTTPS Protocol, nothing happened but a terminal error. I'd really like to confirm this. Not for argument-related reasons, pretty much just to verify things. Beneficial wise.

The winhttp api allows you to set flags for what port to access.

Trancexx's thread is a good place to start to get a quick idea ( a quick look at the constants au3 file would kind of set you on the path ).


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0