Rahul Prasad wrote: > Hi, > > I wont be able to stop download manually by pressing Ctrl+C. > Is there any way to stop wget after downloading fixed number of bytes (Less > than actual size) of a file without explicitly terminating download? > > I thought of an alternate way, to create 0 byte file using /truncate/ and > continuing download, but that doesn't work. > If I create 1 byte file, downloading works but unzipping does not, cuz of > first byte. > > _This is *not* downloading_ > truncate -s0 download.zip > wget -c --header "Range: *0-100*" http://noya.co.in/download.zip > > _Not even this_ > wget -c --header "Range: *1-100*" http://noya.co.in/download.zip > > _This is downloading_ > truncate -s1 download.zip > wget -c --header "Range: *1-100*" http://noya.co.in/download.zip > > But in this case unzipping does not work :( I know. I tested it. If you know that it's a zip file you could cheat. :)
echo -n P > download.zip # We create a 1-byte file with a P. Do not place new lines! wget -c --header "Range: *bytes=1-100*" http://noya.co.in/download.zip # Now this works
