Downloading files from WebGadget

Mac OSX specific forum
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Downloading files from WebGadget

Post by bbanelli »

Greetings,

I have a very simple issue - if I try downloading something from WebGadget (that is, page that loads within it) from Windows, I get "Save file" dialogue and am offered to do so.

However, on OSX, clicking on a link that leads to a file (on the same page that works in Windows) produces no effect.

Am I doing something wrong? Can someone advise?

Thank you in advance,

Bruno
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Downloading files from WebGadget

Post by bbanelli »

The same issue is reproducible on Linux as well.
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Downloading files from WebGadget

Post by bbanelli »

No one? Link is not even obtainable via GetGadgetText() function, since it seems that browser simply ignores it.

I would have used some sort of navigation callback for clicked link to catch it and create my own download manager, but it works nor on OS X, neither on Linux.

Is there really no way to download a file from WebGadget on OS X (and/or Linux)? Is it a bug or a feature?

Obviously, this seems to be the problem. Though I'd only need "Save as" feature, not the actual "manager"...

http://stackoverflow.com/questions/9095 ... ystem-on-a

Edit2: I think I've got it! Will post code here when I tune it up! ;)
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Downloading files from WebGadget

Post by wilbert »

Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Downloading files from WebGadget

Post by bbanelli »

Yes, I've came across that thread and am in process of finishing download manager (or at least the ability to easily download files from WebGadget in Mac OS X). As I've said, will be posting code once I get it to work perfectly! ;)

Speaking of, a question regarding downloading in general - I'm using ReceiveHTTPFile() function to get file, obviously. However, there are problems with redirected links, for example:

Code: Select all

GetHTTPHeader("https://secure.join.me/Download.aspx?installer=mac&webdownload=true")
returns

Code: Select all

HTTP/1.1 302 Redirect
Content-Length: 194
Content-Type: text/html; charset=UTF-8
Location: https://secure.join.me/Download.aspx?installer=mac&webdownload=true
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
X-Client-IP: 141.136.218.97
X-Server-IP: 77.242.192.201
Date: Wed, 20 Nov 2013 07:30:09 GMT
However, when

Code: Select all

ReceiveHTTPFile("https://secure.join.me/Download.aspx?installer=mac&webdownload=true", Filename$)
is called, it once again returns 302 redirected response, not the actual download file. How do "big" browsers settle this issue, since redirect points to the very same link once again (but file gets downloaded in Safari/Firefox/Chrome)?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Downloading files from WebGadget

Post by Shardik »

Wilbert has already posted the link to my example which intercepts a click on a hyperlink in a WebGadget on MacOS. I have also demonstrated the same for Linux:
http://www.purebasic.fr/english/viewtop ... 15&t=54049
Post Reply