Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Copying blob where target name differs only in casing will break the file #892
Which service(blob, file, queue, table) does this issue concern?
Which version of the SDK was used?
9.3.3 (also happens in 5.0.2)
Which platform are you using? (ex: .NET Core 2.1)
.NET Core 2.2 (also happens in .NET Framework 4.5.2)
What problem was encountered?
Our application has a rename feature where the blob is being copied using the target name and the original one is deleted. When the target file name only differs in casing the new blob is created as expected but the file will break (i.e. the downloaded file cannot be opened).
The reproduction steps below uses a .jpg file but I also tried with a .txt file where I found that the file is filled with white spaces and the size will be the same.
How can we reproduce the problem in the simplest way?
I reproduced this issue in a .NET Core 2.2 Console application using the Storage Emulator. Here is the code that I used. The broken file will be created with the
Have you found a mitigation/solution?
UPDATE: If you rename it to a temporary name and then rename it again to the target name (the one which differs only in casing) seems to work but it's a workaround only.