var metaData = new Dictionary<string, string>
(StringComparer.Ordinal)
{
{ "product-id", productId.ToString() }
};
var putObjectArgs = new PutObjectArgs()
.WithBucket("test-bucket")
.WithObject(objectName)
.WithObjectSize(inputStream.Length)
.WithStreamData(inputStream)
.WithHeaders(metaData)
.WithContentType("image/png");
await _minioClient.PutObjectAsync(putObjectArgs, cancellationToken);
Code for me is absolutely correct, but the effect is that Content-Type of the upload file will always be application/octet-stream, where it's strictly specified to be image/png. This is as such a bug.
But apparently If I change order and make WithContentType go BEFORE WithHeaders then it will work correctly and Content-Type will be assigned as it should.
So it looks like specifying WithContentType after WithHeaders has no effect and the default value will be used.
Let's consider the following code:
Code for me is absolutely correct, but the effect is that
Content-Type
of the upload file will always beapplication/octet-stream
, where it's strictly specified to beimage/png
. This is as such a bug.But apparently If I change order and make
WithContentType
go BEFOREWithHeaders
then it will work correctly and Content-Type will be assigned as it should. So it looks like specifying WithContentType after WithHeaders has no effect and the default value will be used.