some code for streaming http data, error on open output directory