Hello all,
Recently, I tried to make a nice counter on my website. I wanted to use a
script named counter.cgi as src of my image. I used this in my page:
<IMG SRC="counter.cgi">
The script was like this:
1. #!/usr/bin/mc
2. on startup
3. open stack "display.mc"
4. wait until url "file:counter.jpg" is not empty
5. put url "file:counter.jpg" into buffer
6. put empty into url "file:counter.jpg"
7.
8. #write minimal set of HTTP headers to stdout
9. put "Content-Type: image/jpeg" & cr
10. put "Content-Length:" && the length of buffer & cr & cr
11. put buffer
12. end startup
And I had a stack in the same dir (in the attachment) which made a
screenshot of a field at openStack and exported it to "counter.jpg".
If I comment line 4 until 6, and place a "counter.jpg" image in the same dir
as the script, it works, but then of course, the image is fixed. Otherwise,
I get a 'Server Internal Error'. For the one who wonders: the stack closes
itself when finished.
My question: Does anyone know how to solve this? Where does the stack place
it files?
Thanks in advance for any help,
Sjoerd
display.mc