简体   繁体   中英

Download Flac file from IIS

I do have several audio files in a directory. In program.CS (vs2022 - Angular 14 with c# backend), I used static files or serverfiles to access the directory. The directory is set to be browseable and anyone can browse it and pick any files to download to their local storage. This work very well for any files except files with flac extension. When I click on the flac file to download, I got error 404. I do have another post regarding playing flac audio file which I do have the same issue - error 404. Please see Play audio.flac vs.fla in IIS via virtual directory

I don't know why Microsoft IIS did not work or like file with FLAC extension. I did report it as a bug to Microsoft but I got no response.

Does any body know any issues with Microsoft IIS and FLAC file extension?

Thanks.

I don't know why Microsoft IIS did not work or like file with FLAC extension. I did report it as a bug to Microsoft but I got no response.

Because it's not a bug. You'll need to add a mimeMap to your website (either by using the IIS Manager or adding it to your web.config manually):

<mimeMap fileExtension=".flac" mimeType="audio/x-flac" />

https://learn.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM