Skip to content

Commit 8c53309

Browse files
committed
FiloInfo file name priority
1 parent 792624c commit 8c53309

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/nuget.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
- name: Build
2626
run: dotnet build --configuration Release
2727

28-
# - name: Test
29-
# run: dotnet test --configuration Release
28+
- name: Test
29+
run: dotnet test --configuration Release
3030

3131
- name: NDepend
3232
uses: ndepend/ndepend-action@v1

ManagedCode.Storage.Core/BaseStorage.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ public Task<Result<BlobMetadata>> UploadAsync(FileInfo fileInfo, UploadOptions o
115115
if (string.IsNullOrWhiteSpace(options.MimeType))
116116
options.MimeType = MimeHelper.GetMimeType(fileInfo.Extension);
117117

118-
options.FileName = fileInfo.Name;
119-
118+
if (string.IsNullOrEmpty(options.FileName))
119+
{
120+
options.FileName = fileInfo.Name;
121+
}
122+
120123
return UploadInternalAsync(fileInfo.OpenRead(), SetUploadOptions(options), cancellationToken);
121124
}
122125

0 commit comments

Comments
 (0)