Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.26k stars 4.6k forks source link

[QUERY] Files from the Blob are downloaded with file guid instead of actual file name #46097

Open harshalsc opened 3 hours ago

harshalsc commented 3 hours ago

Library name and version

Azure.Storage.Blobs 12.20.0

Query/Question

I am experiencing an issue with the Azure.Storage.Blobs 12.20.0 package. When downloading files from the blob, they are being downloaded with a file GUID instead of the actual file name, even after setting the ContentDisposition property.

This is how I am setting the ContentDisposition in my code.

    string contentDisposition = "attachment; filename=\"" + headerName + "\"";
    string contentDispositionEncoded = Uri.EscapeUriString(contentDisposition);

    BlobSasBuilder builder = new BlobSasBuilder(permissions, DateTimeOffset.UtcNow.AddMinutes(UrlExpirationInMinutes));
    builder.ContentDisposition = contentDispositionEncoded;
    var sasUri = blockBlob.GenerateSasUri(builder);

Expected Behavior The file should be downloaded with the actual file name specified in the ContentDisposition property.

Actual Behavior The file is being downloaded with a file GUID instead of the actual file name.

Environment

No response

github-actions[bot] commented 3 hours ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.