in reply to Cannot open file for appending

Anothing point that bears mentioning (and someone correct me if I'm wrong), is that CONTENT-LENGTH I think is a field that is provided raw by the browser, and isn't trustworthy per-se. You might want to try to read STDIN a different way.

    --jaybonci