use standard file mode param, add content_encoding