• Please review our updated Terms and Rules here

New: mTCP HTGet

mbbrutman

Associate Cat Herder
Staff member
Joined
May 3, 2003
Messages
6,424
This was a special request from Carlsson that I finally finished!

HTGet lets you download a file (or whatever content) straight from an HTTP server to your DOS machine. Instead of looking for an FTP server with the file or downloading to another machine first, you can now grab a lot of things straight from the web.

The compiled code is available for testing from: http://www.brutman.com/mTCP/htget.zip . That includes an execuable and instructions. The code is open source and will be available in the next refresh of mTCP in a week or so.

The original HTGet was a WATTCP based application from 1997. This version is a complete re-implementation and has some significant improvements:

  • Support for HTTP 1.1 headers for use with virtual hosts
  • Much faster download speeds than the original
  • The ability to abort a transfer early if needed
  • Somewhat sensible return codes if you are doing batch file programming

Like the original it supports BASIC authentication for password protected content and it can download selectively based on file timestamps.

Please let me know your early comments and I'll try to get them addressed before it becomes official.


Regards,
Mike


PS: Now all we need is somebody to build an HTML rendering engine. ;-0
 
Not exactly. HTGet is simpler than wget - HTTP only and no recursion.

A full blown wget would be ghastly in size. This is 78KB, requires 165KB to run, and runs well on an 8088 class machine. But it is more than capable of pulling a multi-megabyte zip file down from an HTTP server.

(I've been using to pull copies of mTCP right from the Google projects hosting page!)
 
Nice! Eventually I will have a try with this application. In the mean time, I set up a basic FTP server on my XP machine so I could use it as a gateway to e.g. download newer versions of the mTCP package. I assume one needs to know the exact URL in order to use HTGet, or otherwise pull down one file at a time (starting with default index) and analyze the HTML code to go further?
 
Correct - you need to know the URL that you want to fetch ahead of time.

HTGet doesn't look at the content that you are grabbing. It could be a Zip file, JPG, PDF, HTML, or whatever else the server wants to send. So if you have a nice, short direct link to the file that you want, it is easy. Otherwise, you might wind up using something like TinyURL more often, or scripting it in a batch file.

Mike
 
Very nice. I just used htget to get htget.zip -- (well okay, the second time). :)

Sorta wish it was smart enough to understand that when I say "htget http://www.brutman.com/mTCP/htget.zip" that the "-o htget.zip" is implied.
 
Very nice. I just used htget to get htget.zip -- (well okay, the second time). :)

Sorta wish it was smart enough to understand that when I say "htget http://www.brutman.com/mTCP/htget.zip" that the "-o htget.zip" is implied.

On a "real" OS that kind of thing might be possible. But on DOS that leads down a nasty rabbit hole: even if the URL looks like a filename it still might not conform to 8.3 DOS notation with the correct characters. And a lot of URLs don't come close to looking like a filename.

On a related note, if you have special chars in the URL like the ? or &, use quotes around the URL. It works! (I just used htget to pull down this thread to a file.)
 
Next mTCP with HTGet released

Next mTCP with HTGet released

The next mTCP is out, with HTGet included:




There are two versions of the pre-compiled binaries to choose from - standard and "-upx". The "-upx" version binaries are compressed with a program called UPX that decompresses the programs at load time. You will see that the binaries are much smaller in size, and it only takes a little more time to load the programs even on the slowest machines. (One of the subscribers of the FreeDOS mailing list gave me the idea.)

Enjoy,
Mike
 
Nice! Those UPX binaries are in many cases even smaller than general purpose Zip. It reminds me of the C64 and Amiga days when every program was packed and crunched as far as possible, sometimes to the point the program had to display a message on screen to wait for a long decrunch.

Another good use for the compressed binaries is of course when you prepare a floppy disk with packet driver and network software to set up a new computer. In particular if it only takes a 360K floppy, the compressed binaries will make room for more of the mTCP package in one go.
 
Back
Top