When uploading files, setting the type does not work.
I have observed that setting the MIME type of files does not work when uploading them using pycdstar3. I assume the error to be in api.py
on on line 274, in the put_file()
method of class CDStar
:
if isinstance(source, PATH_TYPES):
with open(source, "rb") as source:
return self.put_file(
vault, archive, name, source, type=None, replace=True
)
When put_file
calls itself upon finding a path, type and replace are set to the default values regardless of any values set when calling the method. I changed that to:
if isinstance(source, PATH_TYPES):
with open(source, "rb") as source:
return self.put_file(
vault, archive, name, source, type=type, replace=replace
)
Works like a charm now.