[API-users] Download ZIP-File via VBA

Reetz, Michael (NLPV) Michael.Reetz at nlpv-wattenmeer.niedersachsen.de
Wed May 12 14:18:16 UTC 2021


I'm trying to query and download occurences with some subs written in VBA. While querying works fine, download leads to errors.

At the end oft he query, I have a download link for a ZIP-archive. Putting this into a browser address field lets me download the archive. Giving it to a VBA-Object returns errors.


Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
strURL_Request = "https://api.gbif.org/v1/occurrence/download/" & strDownload
http.setTimeouts 30000, 30000, 30000, 30000
http.Open "GET", strURL_Request, False

returns a jason file that contains the download link. I extract this link and use it as parameter in the next  step:

http.Open "GET", strURL_ZIP, False

This results in a timeout. Using "Microsoft.XMLHTTP" alternativly returns "Access denied"

Is this a problem with our network restrictions or does the GBIF server block the query?

Kind regards

Mit freundlichen Grüßen
Im Auftrag
Michael Reetz
Nationalpark-Verwaltung Niedersächsisches Wattenmeer
Virchowstr. 1
26382 Wilhelmshaven
Tel.: +49 (0) 4421 911 291
Fax.: +49 (0) 441 799 61039
e-mail: michael.reetz at nlpv-wattenmeer.niedersachsen.de<mailto:michael.reetz at nlpv-wattenmeer.niedersachsen.de>
Web: http://www.<http://www.nationalpark-wattenmeer.niedersachsen.de/>nationalpark-wattenmeer.de
Flussgebietsmanagement Übergangs-/Küstengewässer
NLWKN * Betriebsstelle Brake / Oldenburg
e-mail: michael.reetz at nlwkn.niedersachsen.de<mailto:michael.reetz at nlwkn.niedersachsen.de>
Web: http://www.nlwkn.niedersachsen.de<http://www.nlwkn.niedersachsen.de/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gbif.org/pipermail/api-users/attachments/20210512/949a8574/attachment.html>

More information about the API-users mailing list