How to upload file in Azure Blob Storage using c# having file name with accent (à, è, ù) in it.

R Rakesh Kumar 0 Reputation points
2024-07-17T11:53:46.6766667+00:00

I am trying to upload a fle with file name having some accent for example "Rapport Draft à relire".

The UploadAsync method of BloadClient class start giving error as the http request cannot have non ASCII characters . Here we can see the name of the file has non-ASCII character, in case we make it HttpUtility.HtmlEncode(fileName) , it will work fine but the blob name saved in the storage will also become the same, here for example it will become "Rapport Draft à relire" . Now if someone tries to use the method GetBlobClient with the blob name "Rapport Draft à relire" then it will not able to fetch it due to these special characters. Can you suggest what needs to be done in these scenario?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,776 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,501 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.