+ url = "http://{}/{}{}".format(server, PartialPath, getstr)
+
+ self.Message("URL: {}".format(url))
+
+ # setup a new pycurl instance
+ curl = pycurl.Curl()
+
+ # don't want curl sending any signals
+ curl.setopt(pycurl.NOSIGNAL, 1)
+
+ curl.setopt(pycurl.CONNECTTIMEOUT, ConnectTimeout)
+ curl.setopt(pycurl.TIMEOUT, MaxTransferTime)
+
+ # do not follow location when attempting to download a file
+ curl.setopt(pycurl.FOLLOWLOCATION, 0)
+
+ if self.USE_PROXY:
+ curl.setopt(pycurl.PROXY, self.PROXY)
+
+ if DoSSL:
+ curl.setopt(pycurl.SSLVERSION, self.CURL_SSL_VERSION)
+
+ if DoCertCheck:
+ curl.setopt(pycurl.CAINFO, certpath)
+ curl.setopt(pycurl.SSL_VERIFYPEER, 2)
+ else:
+ curl.setopt(pycurl.SSL_VERIFYPEER, 0)
+
+ if dopostdata:
+ curl.setopt(pycurl.POSTFIELDS, postdata)
+
+ # setup multipart/form-data upload
+ if FormData:
+ curl.setopt(pycurl.HTTPPOST, FormData)
+
+ curl.setopt(pycurl.URL, url)
+
+ try:
+ # setup the output file
+ with open(DestFilePath, "wb") as outfile:
+
+ self.Message("Opened output file {}".format(DestFilePath))