If you are outputting binary data such as a PDF or JPG/PNG file, you can make use of the WebBufferOut function after you have called SetWebHeader.
It is important to remember that the SetWebHeader function must be called before any output calls, such as webwrite, webbufferout, etc. The web headers are always sent before browser output, so calling setwebheader after you have already output text to the web browser will not have any effect (unless gzip compression/buffering is on, but it is recommended that you get into the habit of setting the headers first so that your programs function without gzip too).