Hello everyone,
I hope you are well. I'm using the Azure Storage provider, enabled the built-in Azure Storage connector, and then connected to an Azure blog storage location. Once the files are synchronized, when I go to download the files from my DNN site or with the URL provided by the FileManager, the pptx files are downloaded as .zip, if I change the .zip extension to that downloaded file and put pptx it opens good. Here I share some additional observations and results I got during testing and research.
Using the DNN UI to upload the files doesn't happen. This way it is created correctly, in the Azure Storage container in the Content Type column add the correct one for the pptx files, application/vnd.openxmlformats-officedocument.presentationml.presentation. Now when I upload it with another tool in my case I used Azure Storage Explorer it is saved as application/zip. While files with other extensions, like pdf or xlsx, keep the correct content type. I ran into a related issue on Stack Overflow that involves XLSX files in Azure Blob Storage being downloaded as .zip files. You can find the discussion here: Stack Overflow Discussion. What they manage here is the solution of the problem in the code.
It seems that the problem is centered around PPTX files and how Azure Storage handles their content type. There may be a specific setting or property within Azure Storage that is affecting the mapping of content types for PPTX files. Or is it an Azure Storage Explorer configuration problem.
Thank you for taking the time to read this topic. Your help means a lot and I look forward to learning from your experiences.
Sincerely, Alejandro
This is a behavior of Azure Blob Storage if the content type is not set properly on upload. This can happen, often times with uploads via Azure Storage Manager.
You can fix the individual files by modifying the content type and setting it properly in Azure Storage Explorer.
The linked workaround "sort of" works, however, it isn't a great solution as it requires you always to download the file and THEN serve it to the user. The DNN Azure Storage provider is designed to serve the content FROM Azure storage, and not be an intermediate as it negates any gain of using storage.
My suggestion would be to modify the values in the storage account to have the proper content types.
Posted By Mitchel Sellers on 8/29/2023 10:41 AM This is a behavior of Azure Blob Storage if the content type is not set properly on upload. This can happen, often times with uploads via Azure Storage Manager. You can fix the individual files by modifying the content type and setting it properly in Azure Storage Explorer. The linked workaround "sort of" works, however, it isn't a great solution as it requires you always to download the file and THEN serve it to the user. The DNN Azure Storage provider is designed to serve the content FROM Azure storage, and not be an intermediate as it negates any gain of using storage. My suggestion would be to modify the values in the storage account to have the proper content types.
Thanks for your response, Mitch!
This makes me think that this wouldn't be the best way to work with files/folders that would need to be secured, then. Is that correct? If it is correct, then we should use what we've been using then.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.