Skip to content

Commit 683dcb5

Browse files
committed
Fixed content type for azure
1 parent 872c404 commit 683dcb5

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<Product>Managed Code - Storage</Product>
16-
<Version>2.0.5</Version>
17-
<PackageVersion>2.0.5</PackageVersion>
16+
<Version>2.0.6</Version>
17+
<PackageVersion>2.0.6</PackageVersion>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
2020
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

ManagedCode.Storage.Azure/AzureStorage.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ protected override async Task<Result<BlobMetadata>> UploadInternalAsync(Stream s
160160

161161
var uploadOptions = new BlobUploadOptions
162162
{
163-
Metadata = options.Metadata
163+
Metadata = options.Metadata,
164+
HttpHeaders = new BlobHttpHeaders
165+
{
166+
ContentType = options.MimeType
167+
}
164168
};
165169

166170
try

ManagedCode.Storage.AzureDataLake/AzureDataLakeStorage.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,16 @@ protected override async Task<Result<BlobMetadata>> UploadInternalAsync(Stream s
136136
{
137137
try
138138
{
139+
DataLakeFileUploadOptions dataLakeFileUploadOptions = new()
140+
{
141+
HttpHeaders = new PathHttpHeaders()
142+
{
143+
ContentType = options.MimeType
144+
},
145+
};
146+
139147
var fileClient = GetFileClient(options);
140-
await fileClient.UploadAsync(stream);
148+
await fileClient.UploadAsync(stream, dataLakeFileUploadOptions, cancellationToken);
141149

142150
return await GetBlobMetadataInternalAsync(MetadataOptions.FromBaseOptions(options), cancellationToken);
143151
}

0 commit comments

Comments
 (0)