Search code examples
vbscriptasp-classicbinarywriter

Display JPEG using Response.BinaryWrite


I'm displaying an image like this:

<img src='counter.asp'>

counter.asp is doing a hit-counter do determine how often the image was displayed (I'll replace it with a modrewrite URL).

The problem: in the counter.asp script I need to send the actual .jpg image to the browser. How could this be done? I suppose I need to load the image through FSO, and then send it using Response.BinaryWrite - any ideas?


Solution

  • FSO cannot load a binary file, only text. You will need to use a 3th party component.