[英]XLSX files in azure blob storage get downloaded as zip files
We have some files in our Azure blob storage - they are all xlsx files.我们的 Azure blob 存储中有一些文件——它们都是xlsx文件。 When we download them via Azure portal (we navigate to the storage account, then to the container, and then select a file and download it) it downloads and saves as zip file.当我们通过 Azure 门户下载它们时(我们导航到存储帐户,然后导航到容器,然后 select 一个文件并下载它)它下载并保存为 zip 文件。
If after downloading we change its extension to xlsx then Excel will recognize it and open without issues.如果在下载后我们将其扩展名更改为 xlsx,那么 Excel 将能够识别它并正常打开。 However, something is forcing that extension to change from xlsx (as we see it in the container) to the.zip whilst it is downloaded.然而,有些东西迫使该扩展名在下载时从 xlsx(如我们在容器中看到的那样)更改为 the.zip。
The same happens when we access the files programmatically (via c# code) or generate a shared access signature.当我们以编程方式(通过 c# 代码)访问文件或生成共享访问签名时,也会发生同样的情况。
What could it be and how to fix it?它可能是什么以及如何解决它?
Thanks!谢谢!
my work around when accessing xlsx files programmatically with C#, is to manually add the mime type specifically for the xlsx file type as, they were one's giving me issues(pdf and pictures work fine), PS, I store filenames in my DB with a corresponding filename.当使用 C# 以编程方式访问 xlsx 文件时,我的解决方法是手动添加专门针对 xlsx 文件类型的 mime 类型,因为它们给我带来了问题(pdf 和图片工作正常),PS,我将文件名存储在我的数据库中对应的文件名。 ie IE
if (YourModel.FileName.EndsWith("xlsx"))
{
return File(YourModel.FileData, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.