Closed wreckah closed 1 year ago
I found this PR in Python client's repo, but I am not sure, that it's completely correct, because now Python client tries to detect MIME type by file extension. But according to cURL
example, I suppose, that MIME type is automatically detected by using direct upload API resource. And is not detected automatically by using multipart upload API resource.
@wreckah I tested the scenario on the latest gem version: It works well for me
def upload_and_print(filename)
@file_to_upload = File.open(filename)
@uc_file = Uploadcare::Uploader.upload(@file_to_upload)
puts @uc_file.mime_type
end
upload_and_print('test.png') # => image/png
upload_and_print('kitten.jpeg') # => image/jpeg
Library version: 4.3.0 Language/framework version: 2.7.0p0 OS version: Ubuntu 20.04.5 LTS
Describe the bug
Ruby client always uploads files with
mime_type=application/octet-stream
:Expected behavior
Other UC clients provide an original
mime_type
of uploaded file, e.g.:Code / screenshots
Environment