1

I need to download a file, for example: http://gensho.acc.umu.se/debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso with usage of Telnet and HTTP request. How can I do that?

5
  • Have you tried simply using TELNET to connect and typing: get <address>?
    – Adovi
    May 27, 2014 at 2:15
  • @JTYoerger - I was missing double entering and telnet was just prompting for more. May 27, 2014 at 2:22
  • These might help.. googling telnet run command output to file. stackoverflow.com/questions/20970530/… and superuser.com/questions/670866/…
    – barlop
    May 27, 2014 at 3:36
  • 2
    This sounds like an XY problem. Why do you need to use telnet? It's a terrible method to do this. What restricts you from using something designed for this task, e.g. curl or wget?
    – Bob
    May 27, 2014 at 4:18
  • No, this actually is not a XY problem. I was curious how HTTP request looks, with usage of different tools. While I was trying to connect and download the file I was running Wireshark and I saw how it looks like. I wanted to check also, what happens, when for example, I turn off my router and turn on again (how does error frame looks like etc.). Jun 5, 2014 at 17:27

2 Answers 2

1

It has to be Telnet.

Okay, so I figured it out.

telnet gensho.acc.umu.se 80
GET /debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso HTTP/1.0

and double press Enter (that was the part I was missing, the second press of Enter will retrieve data)

However, that still doesn't get this data into a file, (so almost there but not quite)

5
  • Glad you figured it out! Unfortunately, asking other questions in an answer is discouraged. Feel free to ask a new question, and link to this one, to ask the second part. May 27, 2014 at 2:26
  • Glad you figured it out. :)
    – Adovi
    May 27, 2014 at 2:31
  • @JTYoerger He only partially figured it out. He wants it in a file. See his original answer before Luke edited it. Or see the line I added back with an amendment.
    – barlop
    May 27, 2014 at 3:31
  • 1
    To get that into a file, you need to pipe the output into a buffer. Telnet is an interactive program designed for remote shells. It is not designed for file retrieval. That's what FTP was (is) for, and what programs like wget and curl do. I do not know of any way with just telnet.exe to do what you want, because that's not what it's designed for. May 27, 2014 at 4:07
  • @MarkHenderson I haven't tried these but see my comment to his question which gives two links that may help do it
    – barlop
    May 30, 2014 at 16:16
0

Does it HAVE to be telnet? cURL would do a much better, and well designed, job at doing this:

curl -O gensho.acc.umu.se/debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso

1
  • Agreed, curl is the way to go. It's brain dead simple.
    – SaxDaddy
    May 27, 2014 at 5:01

Not the answer you're looking for? Browse other questions tagged .