简体   繁体   English

azure blob 存储中的 XLSX 文件被下载为 zip 文件

[英]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.

相关问题 将文件从 Azure blob 存储移动到 Google 云存储桶 - Moving Files from Azure blob storage to Google cloud storage bucket 从笔记本电脑 spark 读取 Azure blob 存储中的文件时出错 - Error in reading files in Azure blob storage from laptop spark Azure 逻辑应用程序如何将多个 JSON 文件合并到 Blob 存储 - Azure Logic Apps how to combine multiple JSON files to Blob storage Azure App Logic - 如何分页 blob 存储上的文件 - Azure App Logic - How to page files on blob storage Matillion:从 Azure Blob 存储容器和 Windows 文件共享中删除文件 - Matillion: Delete files from Azure Blob Storage Container and Windows Fileshare 我们如何使用 Python 将文件加载到 Azure Blob 存储或 Azure 数据湖存储? - How can we use Python to load files into Azure Blob Storage or Azure Data Lake Storage? Blob 存储 - 直接在其上处理文件 - Blob Storage - handle files directly on it 在 Azure 数据工厂中获取 blob 文件的自定义元数据 - Get custom metadata for blob files in Azure data factory C# - 如何将文件上传到 Azure 存储 Blob(未知物理路径) - C# - How to upload files to Azure Storage Blob (unknown phisic path) 如何使用 arrow::open_dataset 连接到 Azure Blob 存储中的镶木地板文件? - How to connect to parquet files in Azure Blob Storage with arrow::open_dataset?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM