chunk encoding for files; content-length for API