Hello, I need to download a text file from a government website.
Currently the user downloads it manually monthly, and that's Ok, but we want to automatize that part of his work.
I found this article https://knowledgebase.progress.com/articles/Article/How-to-download-PDF-files-from-ABL-code
But we don't have WebSpeed.
Is there another way to download a file from ABL, without WebSpeed?
Actually that code can be used by character, gui, or webspeed. Give it a try. The authorization might need to go or be revised, but that code will do it. If you have that version of Progress.
Else, there is this really old C code I wrote (from 1999!) that will download anything. www.oehive.org/.../gethtml.c
Else you can write one using sockets. www.w3.org/.../rfc2616.html I've done it.
The DataDigger automatically downloads a file from GitHub to verify the version nr and to alert the user that a new version is available. It uses some windows functions to retrieve the file.
You can find the source here. It is easy to modify to get another file.
Better readable here
If you are windows there are plenty of 3rd party .net controls. We use WinSCP and it is very reliable.
So many answers!
Thank you all
We use OE 11.6.3 32bits, client-server, and no .Net
[mention:9e4ee96fac634b8f91b580e1fb4f7e71:e9ed411860ed4f2ba0265705b8793d05], I did't know about that http client.
So I just found this knowledgebase.progress.com/.../Is-there-an-HTTP-client-for-OpenEdge
I downloaded your example and when trying to execiute it receive this message and others.
Could not find class or interface OpenEdge.Net.HTTP.ClientBuilder. (12886)
So I guess we haven't some necessary licenses.
Brian K. Maher (maher),
the source is a website, specifically this url www.sunat.gob.pe/.../AgenRet_TXT.zip
Thank you, Peter, I'll give a try now.
That did it really smoothly, [mention:9e4ee96fac634b8f91b580e1fb4f7e71:e9ed411860ed4f2ba0265705b8793d05] , thanks again!
[mention:05d4bf1e47934b44bc8ab65b8f317551:e9ed411860ed4f2ba0265705b8793d05], [mention:e666fffb14004b29b4bad87b731999a8:e9ed411860ed4f2ba0265705b8793d05] , I didn't try your solutions but probably later will do.
[mention:011caad85a5545659f1a1aaf22be3887:e9ed411860ed4f2ba0265705b8793d05] , here we use a commercial software called NetDrive2 but my guess is that maybe we can gradually replace it with WinSCP, if my tests go good.
Thank you all!
Interesting...we have been using WinSCP for about 5 years with no issues at all. We send some pretty large files as well.
Anyway WinSCP can't assign a Windows local drive letter to a remote SFTP one, and that's a "must" (unless I rewrite the connection part of a group of programs that are working fine).
That's why we chose NetDrive2, I remember now.