i just want to download a file… that’s all
i have created a class called “downloader”. it’s super is HTTPSecureSocket
in the Action event of PushButton1i have this code
dim f as FolderItem = SpecialFolder.Documents.Child("testfile.txt")
dim d as new downloader
'd.Yield = true
'd.Secure = true
'd.ConnectionType = SSLSocket.TLSv11
d.Get("https://www.dropbox.com/s/7wvde758ok2rvrh/testfile.txt?dl=0", f)
You are probably running into HTTP 1.1 and HTTPSecureSocket only does 1.0. You’ll need to upgrade to a version of Xojo that has URLConnection. 2019 R1.1 is good and they did some bug fixes and added some functionality in 2019 R2.
If you can download it via web browser but not the HTTPSocket that’s usually the culprit.
[quote=458487:@BobKeeney]
If you can download it via web browser but not the HTTPSocket that’s usually the culprit.[/quote]
As Bob suggested, use URLConnection. It will follow around redirects as necessary.
i just want to download a file from https://www.filehosting.org/
i don’t know if i have to use URLConnection or HTTPSecureSocket or HTTP 1.1
i tried the example project located in xojo 2019r2 examples folder. it uses URLConnection , but no luck…
same problem with xojo example located at C:\Program Files (x86)\Xojo\Xojo 2016r3\Example Projects\Communication\Internet\HTTPDownloader.xojo_binary_project … it uses HTTPSecureSocket … but with no luck either