I believe he wants to write and save the file to disk, but not the headers returned from the server as well. If this is the case, look for a single $crlf on a line all by itself. Or, probably better yet, look for a two consecitive $crlf togethor. The header is seperated from the body by a blank line. Once you find that first blank line, set a variable like %haveHeader = $true, so you know to write any other blank lines.