in reply to Downloading first X bytes of a file

ISTR that WWW::Mechanize is a sub class of LWP::UserAgent, which has many hooks to achieve stuff like that.

I don't know the specifics, but I guess you could provide :read_size_hint => 512,, and install a callback that handles the first chunk.

I don't know what to do to stop it from downloading the rest (throw an exception perhaps? add Range header?), but that direction seems worth investigating.