# ocifs: setting Content-Type when writing a file to OCI Object Storage
## What was going on
Writing a file to OCI Object Storage with ocifs gave no way to set the Content-Type on the new object: `with fs.open("oci://bucket@namespace/prefix/hello.txt", 'w', autocommit=True) as f: f.write(...)` stored the object without the right MIME type (visible in the OCI console), and passing content_type to open() did not take effect. The SDK equivalent (put_object with content_type=...) worked, but ocifs did not honor the parameter.
## The fix that worked
The library was not wiring the content type through on file writes. Fixed in ocifs 1.3.1: the open() call now both guesses the content type from the file extension when you do not pass one, and honors an explicit content_type= parameter. Upgrade ocifs to 1.3.1 or later and write with:
with fs.open("oci://bucket@namespace/prefix/file.png", 'wb', autocommit=True, content_type='image/png') as f:
f.write(data)
Omit content_type and ocifs sets the standard MIME mapping (text/plain for .txt, etc.) automatically.
## Where this came from
https://github.com/oracle/ocifs/issues/28