Download a file from ABL

Posted by ezequielmontoya on 07-Feb-2018 13:23

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?

Posted by Peter Judge on 09-Feb-2018 07:28

It’s not a license thing :)
 
You need to add $DLC/gui/netlib/OpenEdge.Net.pl or  $DLC/tty/netlib/OpenEdge.Net.pl to PROPATH (depending on what platfom you’re running on).
 

All Replies

Posted by Peter Judge on 07-Feb-2018 13:26

Which version are you on?
 
There’s a general-purpose HTTP client that’s been available since about 11.5.1
 

Posted by Brian K. Maher on 07-Feb-2018 13:26

Where is the file coming from?  Web site?  Secure FTP site?  Something else?

Posted by scott_auge on 07-Feb-2018 20:21

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.

Posted by Patrick Tingen on 08-Feb-2018 01:24

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

Posted by Roger Blanchard on 08-Feb-2018 07:02

If you are windows there are plenty of 3rd party .net controls. We use WinSCP and it is very reliable.

Posted by ezequielmontoya on 08-Feb-2018 15:48

So many answers!

Thank you all

We use OE 11.6.3 32bits, client-server, and no .Net

Posted by ezequielmontoya on 08-Feb-2018 15:55

[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.

Posted by ezequielmontoya on 08-Feb-2018 15:57

Brian K. Maher (maher),   

the source is a website, specifically this url www.sunat.gob.pe/.../AgenRet_TXT.zip

Posted by Peter Judge on 09-Feb-2018 07:28

It’s not a license thing :)
 
You need to add $DLC/gui/netlib/OpenEdge.Net.pl or  $DLC/tty/netlib/OpenEdge.Net.pl to PROPATH (depending on what platfom you’re running on).
 

Posted by ezequielmontoya on 09-Feb-2018 14:06

Thank you, Peter, I'll give a try now.

Posted by ezequielmontoya on 12-Feb-2018 12:59

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!

Posted by Tim Kuehn on 12-Feb-2018 13:22

A while ago I used WinSCP for a project and it worked great - until it didn't. W/out support I couldn't figure out what the issue was.I don't remember the specifics beyond that you need to keep an eye on it and have a commercial, supported product lined up as a potential replacement "just in case"

Tim 

Posted by Roger Blanchard on 12-Feb-2018 16:16

Interesting...we have been using WinSCP for about 5 years with no issues at all. We send some pretty large files as well.

Posted by ezequielmontoya on 13-Feb-2018 06:28

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.

This thread is closed