how to make wget use binary mode?

Red Squirrel

No Lifer
May 24, 2003
67,418
12,146
126
www.anyf.ca
I'm trying to download an iso using wget but its using text/plain, so when its done, the iso is corrupted. How can I force it to use binary? I can't seem to find the option in the --help page to specify it.
 

Cogman

Lifer
Sep 19, 2000
10,277
125
106
wget by default should use binary. Here is the manual

http://www.cbi.pku.edu.cn/Doc/CS/wget/man.wget.html

and here is a quote from the manual.

"Wget is a utility designed for retrieving binary documents across the Web, through the use of HTTP (Hyper Text Transfer Protocol) and FTP (File Transfer Protocol), and saving them to disk."
 

Cogman

Lifer
Sep 19, 2000
10,277
125
106
my suggestion is to make sure you are getting the iso, sometimes websites put a cute php script inbetween that will screw everything up. Also make sure it is not a torrent file.
 

Red Squirrel

No Lifer
May 24, 2003
67,418
12,146
126
www.anyf.ca
Yeah I double checked that it was a http directory listing. This is the output:

ryan@borg:/data3/p2p/temp$ wget http://mirror.cogentco.com/pub...6/iso/F-7-i386-DVD.iso &
[1] 7824
--17:55:25-- http://mirror.cogentco.com/pub...6/iso/F-7-i386-DVD.iso
=> `F-7-i386-DVD.iso.1'
Resolving mirror.cogentco.com... ryan@borg:/data3/p2p/temp$ 204.157.3.70
Connecting to mirror.cogentco.com|204.157.3.70|:80... connected.
HTTP request sent, awaiting response...
ryan@borg:/data3/p2p/temp$ 200 OK
Length: 2,900,602,880 (2.7G) [text/plain]

0% [ ] 0 --.--K/s
0% [ ] 9,851 47.16K/s
100%[==================================>] 2,900,602,880 300.53K/s ETA 00:00

20:53:22 (265.29 KB/s) - `F-7-i386-DVD.iso.1' saved [2900602880/2900602880]


[1]+ Done wget http://mirror.cogentco.com/pub...6/iso/F-7-i386-DVD.iso




Actually just decided I'll just use my p2p vm and use firefox to download stuff. My original plan was to just use wget on the server then let it go in the background, but doing it in the VM is a better idea so I can monitor the progress without keeping a window open. My main goal is to keep large downloads off my machine so I don't have to worry about interrupting it. The VM will work great for this.

Though getting wget to work with binary wont work for future use. I've never actually had this issue before, may be that particular mirror the way its sending the response so wget thinks its a web page.
 

JoeDoe44

Junior Member
Aug 9, 2007
9
0
0
try torrenting it then. That is probably the safest way to get what you want. Azureus is ported to linux
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: JoeDoe44
try torrenting it then. That is probably the safest way to get what you want. Azureus is ported to linux

Yep. Although I don't know if I'd recommend Azereus altogether. There are lighter weight things that work as well for casual use.

But either way, bittorrent is generally faster and it is designed to ensure data integrity. It does running checksums so that if you complete a download you know for a fact that it's 100% correct.

How do you know the downloaded file is corrupt?


Yea. I am curious also.
 

Red Squirrel

No Lifer
May 24, 2003
67,418
12,146
126
www.anyf.ca
My isp limits flows, so p2p, torrents etc don't really work for me as those tend to take lot of flows for connection handling. Has to be a direct download. And I know the file is corrupt since I get some error when I open it with an iso viewer (winrar, winiso etc), can't recall the error, but something like "fatal error <1024 file corrupt" with lot of numbers and such. But since it happened with firefox too, I'm starting to think it may be corrupted on the website itself. I'm sure they'd know by now, but maybe it takes a while for mirrors to replicate.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Try it anyways. This isn't illegal software stuff.. people generally are nice and there are many more seeders then downloaders. Usually, unless it's a brand new release or relatively minor distribution, you do very little actual uploading when downloading a Linux install cdrom.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Oh, and to be sure about the download you run checksum on the iso file.

Generally there is a text file on the same ftp or web server as the iso file. This is usually called md5sums.txt or something similar. In it will be a number hash. Also you can find this number on different servers, so you can compare to what other people have hosted.

To find out if your file is realy corrupted you download md5sum.exe and run it on the ISO file. If the number that is produced by the md5sum program matches the one on the online text file then you know it's correct. If the ISO file is corrupted by even 1 bit the number will be completely different.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I'm trying to download an iso using wget but its using text/plain, so when its done, the iso is corrupted.

wget isn't the issue. Windows differentiates between binary and text files by unix doesn't. Sure it would be a good idea to fix the mime type of ISOs on their webserver but it won't affect anything for you.