Skip to content

Set blob Content-Type in AzureBlobFileSystem.put() #294

@jhamman

Description

@jhamman

Is it possible to set the Content-Type attribute (or other content settings) of blobs using adlfs?

I would like to do something like this:

fs = AzureBlobFileSystem(...)
fs.put('index.html', 'foo/bar', content_settings={'Content-Type': 'text/html'})

This does seem to be possible when using the azure storage library directly. For example:

blob_client = ...
with open(index.html, "rb") as data:
    blob_client.upload_blob(data, content_settings=ContentSettings(content_type='text/html'))

I suspect this is possible today but the above example does not work so I'm looking for examples and/or documentation to support this sort of workflow.

cc @orianac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions