in reply to How do I retrieve a piece of a file?

If the request is not going as planned, perhaps due to missing HTTP/1.1 method support on the server side, there are two ways to solve this issue.

First, if all you want is the first 4096 bytes, but don't mind downloading the extra, you can use substr to extract the required data.

Otherwise, if you are using only the first 4K of a really large file, if you are able to, deploy a quick CGI on the server-side which will send you the first 4K. Make sure to keep it either simple (i.e. only sends 4K of a particular file), or secure (i.e. HTTP authentication, or such).

A more brute-force approach would be to just terminate the connection after you get what you need.
  • Comment on Re: How do I retrieve a piece of a file?